CoverFlow with image jpg is possible ?

CoverFlow with image jpg is possible ?

Postby vilian » Sun Oct 11, 2009 2:38 am

CoverFlow with image jpg is possible ?
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: CoverFlow with image jpg is possible ?

Postby Daniel Garcia-Gil » Sun Oct 11, 2009 3:14 am

Hi vilian.


You can use TImage Class to load jpg and after use Method AddCoverH( hBmp, cText, nClrText ) to add image handle
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: CoverFlow with image jpg is possible ?

Postby Antonio Linares » Sun Oct 11, 2009 5:37 am

Vilian,

You can review Class TCoverFlow documentation here:
http://wiki.fivetechsoft.com/doku.php?id=fivewin_class_tcoverflow
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42086
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: CoverFlow with image jpg is possible ?

Postby vilian » Sun Oct 11, 2009 3:45 pm

Thanks,

Its ok.
Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
User avatar
vilian
 
Posts: 975
Joined: Wed Nov 09, 2005 2:17 am
Location: Brazil

Re: CoverFlow with image jpg is possible ?

Postby PeterHarmes » Fri Jan 13, 2012 11:36 am

Hi,

I'm trying to get coverflow working with jpg images but only get a black screen with the filename appearing at the bottom in white, can somebody look at my code and let me know where i'm going wrong?

Code: Select all  Expand view

FUNCTION ViewImages( oDlg )
    LOCAL aFiles  := {}
    LOCAL aImages := {}
    LOCAL nCount  := 0
    LOCAL oWnd
    LOCAL oCF
   
    aFiles := DIRECTORY("IMAGES\" + Alltrim( Str( TRANSFIL->(RECNO()), 8, 0) ) + "*.JPG")
    IF !Empty( aFiles )
        FOR nCount := 1 to Len( aFiles )
            ? "
IMAGES\" + aFiles[nCount,1]
            Aadd( aImages, TImage():Define( , "
IMAGES\" + aFiles[nCount,1], oDlg ) )
        NEXT
    ENDIF
   
    IF !Empty( aImages )
       
        DEFINE WINDOW oWnd  FROM 2, 2 TO 40, 96 color CLR_BLACK, CLR_CYAN

        oWnd:Center()
 
        oCF = TCoverFlow():New( 30, 30 )

//    oCF:bAction = { | o, nCover, nOld | msginfo( "
Seleted: " + str( nCover, 2 ) + CRLF + "From: " + str( nold ) ) }

        oCF:nMaxCover    = 5
   
        oCF:lAnimated= .T.
        oCF:SetColor( 0, CLR_BLACK )
       
        FOR nCount := 1 TO Len( aImages )
            oCF:AddCoverH( aImages[nCount], aFiles[nCount, 1], CLR_WHITE  )
        NEXT

        oWnd:oClient = oCF

        ACTIVATE WINDOW oWnd on init( oCF:Resize(), oCF:Refresh() )
    ENDIF
RETURN NIL


Thanks in advance

Pete
PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England

Re: CoverFlow with image jpg is possible ?

Postby PeterHarmes » Fri Jan 13, 2012 2:10 pm

Ignore last post, now fixed - code below:

Code: Select all  Expand view


FUNCTION ViewImages( oDlg )
    LOCAL aFiles  := {}
    LOCAL aImages := {}
    LOCAL nCount  := 0
    LOCAL oImage
    LOCAL oWnd
    LOCAL oCF
   
    aFiles := DIRECTORY("IMAGES\" + Alltrim( Str( TRANSFIL->(RECNO()), 8, 0) ) + "*.JPG")
    IF !Empty( aFiles )
        FOR nCount := 1 to Len( aFiles )           
            oImage := TImage():New( , , , , , , ,oDlg)
            oImage:cBmpFile := "
IMAGES\" + aFiles[nCount,1]
            oImage:LoadBmp( "
IMAGES\" + aFiles[nCount,1] )

            Aadd( aImages, oImage:hBitmap  )
        NEXT
    ENDIF
   
    IF !Empty( aImages )
       
        DEFINE WINDOW oWnd  FROM 2, 2 TO 40, 96 color CLR_BLACK, CLR_CYAN

        oWnd:Center()
 
        oCF = TCoverFlow():New( 30, 30 )

//    oCF:bAction = { | o, nCover, nOld | msginfo( "
Seleted: " + str( nCover, 2 ) + CRLF + "From: " + str( nold ) ) }

        oCF:nMaxCover    = 5
   
        oCF:lAnimated= .T.
        oCF:SetColor( 0, CLR_BLACK )
       
        FOR nCount := 1 TO Len( aImages )
            oCF:AddCoverH( aImages[nCount], aFiles[nCount, 1], CLR_WHITE  )
        NEXT

        oWnd:oClient = oCF

        ACTIVATE WINDOW oWnd on init( oCF:Resize(), oCF:Refresh() )
    ENDIF
RETURN NIL

PeterHarmes
 
Posts: 363
Joined: Wed Feb 15, 2006 2:06 pm
Location: Oxford, England


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 80 guests