If I have a bitmap showed on a dialog
sample
can I refill only the black arrow with a different color ( RED, BLU,YELLOW) ?
I wish that the arrow must be refilled by end user with the mouse
How I can make this ?
refill a bitmap
Re: refill a bitmap
It must be the same BMP ( size ) but with a red Arrow. A BMP for each color.
You can replace the BMP with the black Arrow with the one with the red Arrow.
// from File
// REDEFINE BITMAP oBmp1 ID 100 OF oDlg FILENAME Black.bmp"
// from resource
REDEFINE BITMAP oBMP1 ID 100 ADJUST RESOURCE "Black" OF oDlg
oBMP1:bPainted := {|hDC| ReplaceBMP ( oBMP1, newBMP1 ) }
A oBMP1:Refresh() will replace the BMP with newBMP1
( can be a Button-action or Mouse-focus )
// Replace BMP on MouseClick
REDEFINE BITMAP oBMP1 ID 100 ADJUST RESOURCE "Black" OF oDlg ;
ON CLICK ReplaceBMP ( oBMP1, "Red.bmp" )
// ------------ Replace ------------
FUNCTION ReplaceBMP( oBitmap, cBitmap)
Local oImage
DEFINE IMAGE oImage FILENAME cBitmap
aRect := GETCLIENTRECT( oBitmap:hWnd )
PalBmpDraw( oBitmap:GETDC(), 0, 0, oImage:hBitmap, , aRect[4], aRect[3] )
oBitmap:ReleaseDC()
RETURN( NIL )
Best Regards
Uwe
You can replace the BMP with the black Arrow with the one with the red Arrow.
// from File
// REDEFINE BITMAP oBmp1 ID 100 OF oDlg FILENAME Black.bmp"
// from resource
REDEFINE BITMAP oBMP1 ID 100 ADJUST RESOURCE "Black" OF oDlg
oBMP1:bPainted := {|hDC| ReplaceBMP ( oBMP1, newBMP1 ) }
A oBMP1:Refresh() will replace the BMP with newBMP1
( can be a Button-action or Mouse-focus )
// Replace BMP on MouseClick
REDEFINE BITMAP oBMP1 ID 100 ADJUST RESOURCE "Black" OF oDlg ;
ON CLICK ReplaceBMP ( oBMP1, "Red.bmp" )
// ------------ Replace ------------
FUNCTION ReplaceBMP( oBitmap, cBitmap)
Local oImage
DEFINE IMAGE oImage FILENAME cBitmap
aRect := GETCLIENTRECT( oBitmap:hWnd )
PalBmpDraw( oBitmap:GETDC(), 0, 0, oImage:hBitmap, , aRect[4], aRect[3] )
oBitmap:ReleaseDC()
RETURN( NIL )
Best Regards
Uwe
Last edited by ukoenig on Sun Jan 17, 2010 10:46 pm, edited 1 time in total.
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.
- MdaSolution
- Posts: 401
- Joined: Tue Jan 05, 2010 2:33 pm
Re: refill a bitmap
sorry But I found the function FloodFill
I think it can be done calculating the coors the bitmaps
FloodFill(hCDC, x,y , CLR_BLACK, nColor)
but I not Know How Found the coors of the bitmap
I think it can be done calculating the coors the bitmaps
FloodFill(hCDC, x,y , CLR_BLACK, nColor)
but I not Know How Found the coors of the bitmap
FWH .. BC582.. xharbour