When I use the code below, my alpha blended bmp is painted with black background instead of being transparent.
Which part I went wrong?
Code: Select all
hBmp2 := ReadBitMap(0, ud_bmpDir()+"\2021.bmp")
DrawBitmap( hDC, hBmp2, nTop, nLeft)
Code: Select all
hBmp2 := ReadBitMap(0, ud_bmpDir()+"\2021.bmp")
DrawBitmap( hDC, hBmp2, nTop, nLeft)
Code: Select all
// image location
c_Path := cFilePath(GetModuleFileName( GetInstance() ) )
c_Path1 := c_Path + "BITMAPS\"
...
...
// inside window define
oWnd:bPainted := < |hDC|
DRAWIMAGE( oWnd )
RETURN NIL
>
...
...
/ -----------------
FUNCTION DRAWIMAGE( oWnd )
LOCAL oGraphics := Graphics():New( oWnd:hDC )
LOCAL oImage := GDIBmp():new( c_path1 + "FWH.bmp" ) // Image
// position top, left
oGraphics:DrawImage( oImage, 493, 15, oImage:GetWidth(), oImage:GetHeight() )
oGraphics:Destroy()
oImage:End()
RETURN NIL