CoverFlow with image jpg is possible ?
CoverFlow with image jpg is possible ?
Hi vilian.
You can use TImage Class to load jpg and after use Method AddCoverH( hBmp, cText, nClrText ) to add image handle
Thanks,
Its ok.
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 NILFUNCTION 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