how to erase line on the plane

Hi everyone

I use PgDrawILine(a,b,c,d) to plot some date, the question is, if I would like to erase them on the same plane, what kind of function I need to use? Not to close the current plane or windows, but just erase them, any suggestions? thank you

You have to draw over them with the background color. When you use Pg* it`s all raw operations, once the pixel are drawn there is no record of the operation, no information to perform an erase on. That one difference with Pt*

Thanks. But how to draw with background color? If I would like to draw with brown, the same color as the plane, so what function need to use? Also, could u explain more about Pt and Pg? Thank you!

If you are in control of the background color, then you use the same line command that put the line out. If you are not in control of the background, well get in control. If you can’t then you have to do something inefficient. You could send out a “reveal” event so the background repaints. Then you would have to repaint your stuff without the offending line.

Asking about Pt and Pg means you havent done youre homeword and read the documentation.

I find that once I plot the curve on the window and minimize the window, the graph will disappear once the window come out again, so the curve which drawed by PgDrawILine can only exist for the current window? Why once the window is minimized and restored, the graph just gone?

Photon doesn’t keep a graphic image for you. If you use a “raw” widget one of its properties is a draw function. In the draw function, the context is already set up for you. It gets called whenever you need to update the image. If drawing takes a lot of time, you can pre-compute the image and then just blit it onto the screen. If it’s just a big image that takes a lot of bandwidth, the graphics function gets a list of rectangles that need to be updated.