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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing Lines from TCanvas

Status
Not open for further replies.

Brollo

Programmer
Jan 19, 2004
2
BE
Hi, I am developing an application which draws lines between certain points. I am using the MoveTo and LineTo functions of the TCanvas property to do this.
Is there a way to remove the last drawn line from the canvas without affecting the previous drawn lines ?
I've tried drawing a line over the existing line with the Pen.Style property set to psClear but this does not seem to work.

Any ideas ?
 
I'm pretty sure not. The canvas is a bitmap, i.e. collection of pixels. Each pixel remembers what its current colour is and that's it. The canvas has no concept that a line exists on it, only that certain pixels are a different colour.

You would have to re-draw the line in white, not clear. but it would cut any other lines that cross it.

Anyone know how Microsoft implement undo in Paint?

Have fun
Simon
 
Shouldn't you XOR the same LineTo in the same color with the same coordinates?

HTH
TonHu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top