Filling a window fragment

Post Reply
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Filling a window fragment

Post by Natter »

The FloodFill function() fills the DC of the entire window. How can this be done for a specific area of the window?

User avatar
Antonio Linares
Site Admin
Posts: 44515
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: Filling a window fragment

Post by Antonio Linares »

Dear Yuri,

You may use FillRect():

FillRect( hDC, { nTop, nLeft, nBottom, nRight }, hBrush ) --> nSuccess (0 or 1)

Example of use:

Code: Select all | Expand

#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 nil
regards, saludos

Antonio Linares
www.fivetechsoft.com
Natter
Posts: 1402
Joined: Mon May 14, 2007 9:49 am

Re: Filling a window fragment

Post by Natter »

Thank you, Antonio! That's what I did, it works well

Post Reply