Function Main ()
local ownd
local oimg
DEFINE WINDOW oWnd TITLE "Testing GDI+ Class" FROM 5,5 TO 500, 890 PIXEL ;
COLOR CLR_GRAY, CLR_GRAY
@ 20,12 button "crear" size 40,20 pixel Action oBmpLoadFromFile( oImg, 640, 400 )
@ 20 ,130 Button "salir" Action ownd:end() size 40,20 pixel
@ 3, 28 BITMAP oimg FILE "" size 640,400 of oWnd
ACTIVATE WINDOW oWnd
Return (nil)
Function oBmpLoadFromFile( oBmp, nWidth, nHeight )
local hBmpOld := oBmp:hBitmap
local hPalOld := oBmp:hPalette
local ohBmp
local hBmp := 0
local cFile:= cGetfile("coge","*.*")
if ! Empty( cFile )
ohBmp := GDIBmp():new(cFile)
if ( ! Empty( nWidth ) .or. ! Empty( nHeight ) )
ohBmp:Resize( nWidth, nHeight )
endif
hBmp := ohBmp:GetGDIHbitmap()
ohBmp:End()
endif
oBmp:hBitmap := hBmp
oBmp:hPalette := 0
if ! Empty( hBmpOld )
PalBmpFree( hBmpOld, hPalOld )
endif
obmp:HasAlpha()
obmp:refresh()
RETURN nil
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 38 guests