FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour CoverFlow with image jpg is possible ?
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
CoverFlow with image jpg is possible ?
Posted: Sun Oct 11, 2009 02:38 AM

CoverFlow with image jpg is possible ?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: CoverFlow with image jpg is possible ?
Posted: Sun Oct 11, 2009 03:14 AM

Hi vilian.

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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: CoverFlow with image jpg is possible ?
Posted: Sun Oct 11, 2009 05: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
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: CoverFlow with image jpg is possible ?
Posted: Sun Oct 11, 2009 03:45 PM

Thanks,

Its ok.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: CoverFlow with image jpg is possible ?
Posted: 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 (fw): Select all Collapse
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
Posts: 363
Joined: Wed Feb 15, 2006 02:06 PM
Re: CoverFlow with image jpg is possible ?
Posted: Fri Jan 13, 2012 02:10 PM
Ignore last post, now fixed - code below:

Code (fw): Select all Collapse
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

Continue the discussion