Page 1 of 1

CoverFlow with image jpg is possible ?

PostPosted: Sun Oct 11, 2009 2:38 am
by vilian
CoverFlow with image jpg is possible ?

Re: CoverFlow with image jpg is possible ?

PostPosted: Sun Oct 11, 2009 3:14 am
by Daniel Garcia-Gil
Hi vilian.


You can use TImage Class to load jpg and after use Method AddCoverH( hBmp, cText, nClrText ) to add image handle

Re: CoverFlow with image jpg is possible ?

PostPosted: Sun Oct 11, 2009 5:37 am
by Antonio Linares
Vilian,

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

Re: CoverFlow with image jpg is possible ?

PostPosted: Sun Oct 11, 2009 3:45 pm
by vilian
Thanks,

Its ok.

Re: CoverFlow with image jpg is possible ?

PostPosted: Fri Jan 13, 2012 11:36 am
by PeterHarmes
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

Re: CoverFlow with image jpg is possible ?

PostPosted: Fri Jan 13, 2012 2:10 pm
by PeterHarmes
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