Graphics - removing a line
-
Can anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?
chris fearnley wrote: without having to invalidate and redraw the original image? What's the problem? Do you have double buffering on? David
-
chris fearnley wrote: without having to invalidate and redraw the original image? What's the problem? Do you have double buffering on? David
-
Can anyone explain how I can draw a line over an existing image, then later remove it (by redrawing it in some clever way) without having to invalidate and redraw the original image?
Take a look at ControlPaint.DrawReversibleLine[^] "I think I speak on behalf of everyone here when I say huh?" - Buffy
-
David, Is double buffering relevant? In MFC, I used CDC::SetROP2 to get a whole range of options about combining pixels. I'm trying to find the equivalent in .NET. Thanks for replying.
chris fearnley wrote: Is double buffering relevant? Well, no :). You wrote "(by redrawing it in some clever way) without having to invalidate and redraw the original image?" so I thought that you have performance problem... There was a chance that with double buffering you won't need "clever way" to do it. Back on topic, if ControlPaint.DrawReversibleLine suggested by Mathew won't work for you, maybe you can interop with GDI. http://pinvoke.net/default.aspx/gdi32/SetROP2.html[^]. It look like there isn't managed solution, but then again I am no GDI/DGI+ expert :). David
-
chris fearnley wrote: Is double buffering relevant? Well, no :). You wrote "(by redrawing it in some clever way) without having to invalidate and redraw the original image?" so I thought that you have performance problem... There was a chance that with double buffering you won't need "clever way" to do it. Back on topic, if ControlPaint.DrawReversibleLine suggested by Mathew won't work for you, maybe you can interop with GDI. http://pinvoke.net/default.aspx/gdi32/SetROP2.html[^]. It look like there isn't managed solution, but then again I am no GDI/DGI+ expert :). David