Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TCanvas, clear?

Status
Not open for further replies.

inetd

Technical User
Jan 23, 2002
115
0
0
HK
How to clear the contents drawn in TCanvas?
 
don't know if there is a better way but this works:

TRect r;
r.left = 0;
r.top = 0;
r.right = this->Width;
r.bottom = this->Height;
this->Canvas->Brush->Color = clYellow;
this->Canvas->FillRect(r);
 
Use FloodFill with a border color not used in
the current canvas, for instance:
Form1->Canvas->FloodFill(1,1,0x00fefefe,fsBorder);
Where "fefefe" is the limiting, non exixting color in GBR notation.
 
I have got an idea!! When you have for example Form1->Canvas you could use Repaint. When you have an image canvas then you could write Form1->Image1->Picture=NULL. I use this kind of code in my programs:D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top