hDC := CreateCompatibleDC( oParent:GetDC() )
hBmp := CreateCompatibleBitMap( hDC, nRechts, nUnten )
hBmpOld := SelectObject( hDC, hBmp )
drawing_function(hDc,...)
SelectObject( hDC, hBmpOld )
DeleteDC( hDC )
DeleteObject( hBmpOld )
oParent:ReleaseDC()
return hBmp
oImage := GdiBmp():New()
oImage:hBmp := GDIP_FromHBitmap( hBitmap,,HasAlpha( hBitmap ) )
oImage:Save( "filenamewithExt" ) // for jpg, add nQuality as 2nd param
oImage:End()
function TestDraw()
local oDlg, oBtn, aMyDrawing
aMyDrawing := MyDrawing()
DEFINE DIALOG oDlg SIZE 300,200 PIXEL TRUEPIXEL
@ 40,100 BTNBMP SIZE 100,128 PIXEL OF oDlg ;
PROMPT "NATURE" BITMAP { 90, 90, aMyDrawing }
ACTIVATE DIALOG oDlg CENTERED
return nil
function MyDrawing()
local aDrawing
local aSky := { 'R', RGB( 111, 183, 255 ), 0, 64, 64, 0, 0, 63, 63 }
local aSun := { 'E', RGB( 254, 227, 167 ), 0, 64, 64, 7, 7, 55, 55 }
local aHill := { 'L', RGB( 187, 108, 85 ), 0, 64, 64, 63, 0, 52, 0, 42, 16, 52, 32, 40, 48, 60, 63, 63, 63 }
local aGrn := { 'L', RGB( 64, 128, 64 ), 0, 64, 64, 63, 0, 60, 0, 56, 20, 60, 32, 56, 48, 61, 63, 63, 63 }
local aBrd := { 'R', CLR_BLACK, 1, 64, 64, 0, 0, 63, 63 }
aDrawing := { aSky, aSun, aHill, aGrn, aBrd }
return aDrawing
ukoenig wrote:Mr. Rao,
there is a problem using GDIPLUS, because on window or dialog-resize
images are deleted. Silvio reported this problem as well.
Is there any solution to solve the problem ?
best regards
Uwe
oImage := GdiBmp():New()
oImage:hBmp := GDIP_FromHBitmap( hBitmap,,HasAlpha( hBitmap ) )
oImage:Save( "filenamewithExt" ) // for jpg, add nQuality as 2nd param
oImage:End()
cCLSID = AnsiToWide( cCLSID )
cFile = AnsiToWide( cFile )
C:\WGUN\GUN1\IM_EX\TRAINING\xtemp.jpg
METHOD Save( cFile , nQuality ) CLASS GDIBmp
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 22 guests