The FloodFill function() fills the DC of the entire window. How can this be done for a specific area of the window?
The FloodFill function() fills the DC of the entire window. How can this be done for a specific area of the window?
Dear Yuri,
You may use FillRect():
FillRect( hDC, { nTop, nLeft, nBottom, nRight }, hBrush ) --> nSuccess (0 or 1)
Example of use:
#include "FiveWin.ch"
function Main()
local oWnd
DEFINE WINDOW oWnd TITLE "FillRect Example"
ACTIVATE WINDOW oWnd ON PAINT PaintArea( oWnd )
return nil
function PaintArea( oWnd )
local oBrush
DEFINE BRUSH oBrush COLOR RGB( 255, 0, 0 ) // red
FillRect( oWnd:hDC, { 10, 10, 100, 200 }, oBrush:hBrush )
RELEASE BRUSH oBrush
DEFINE BRUSH oBrush COLOR RGB( 0, 0, 255 ) // blue
FillRect( oWnd:hDC, { 110, 10, 200, 200 }, oBrush:hBrush )
RELEASE BRUSH oBrush
return nilThank you, Antonio! That's what I did, it works well