Thread: Display Bitmaps
View Single Post
  #14 (permalink)  
Old 02-01-2007, 02:46 PM
Paulo Oliveira
Guest
 
Posts: n/a
Default Re: Display Bitmaps

Hi James

FabPaintLibCtrl works like a dream for me.
Look an example:

METHOD ShowImagem() CLASS DWFTecGeral
LOCAL oFile AS FileSpec
LOCAL oError AS USUAL
SELFImg:=NULL_OBJECT
SELFImg:=FabPaintLib{}
BEGIN SEQUENCE
IF !SELFDCbBGeralFT:SERVER:CIMAGEM==NIL
IF !Empty(AllTrim(SELFDCbBGeralFT:SERVER:CIMAGEM))
SELF:cImagemFT:=POGetAppObject():cImg_Path
+"\"+SELFDCbBGeralFT:SERVER:CIMAGEM
ELSE
SELF:cImagemFT:=""
END IF
ELSE
SELF:cImagemFT:=""
ENDIF
IF Empty(SELF:CIMAGEMFT)
BREAK 1
END IF
IF Len(AllTrim(SELF:cImagemFT))==0
BREAK 1
END IF
GetAppObject():Exec(EXECWHILEEVENT)
oFile:=filespec{AllTrim(SELF:cImagemFT)}
IF oFile:Find()
SELFImg:CreateFromFile(oFile:FullPath)
ELSE
SELFImg:CreateFromResourceName(_GetInst(),"DEL_I MAGEM")
END IF
SELFDCCCImagem:Image:=SELFImg
SELFDCCCImagem:ImageFit:=TRUE
oFile:=NULL_OBJECT
RECOVER USING oError
SELFImg:CreateFromResourceName(_GetInst(),"SEM_I MAGEM")
SELFDCCCImagem:Image:=SELFImg
SELFDCCCImagem:ImageFit:=TRUE
END SEQUENCE
RETURN NIL

In my case i have two resources DEL_IMAGEM (if the image of the item
was delete) and SEM_IMAGEM (if not exist a image associate to item.
When scrolling the browser, i call the method ShowImagem(), in the
same way i use fabPaintLib in my bBrowser to display thumbnails in a
Column.

Paulo Oliveira


On Jan 31, 5:11 pm, "CygNet" <j...@wecover.net> wrote:
> Could someone tell me when the expose() gets called? Does the PostInit() run
> before it or after it. I need to get the name of the bitmap to a variable
> before the expose() method gets called. Preinit() is too early because the
> database is not yet asigned to the window. I could work around this
> specifying it by the method from which the window is opened, but it seems a
> bit crude.
>
> James



Reply With Quote