Skip navigation.
Home
The QNX Community Portal

View topic - how to erase line on the plane

how to erase line on the plane

Isn't the name clear?

how to erase line on the plane

Postby bzxaggio » Tue Nov 23, 2010 9:50 pm

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
bzxaggio
Active Member
 
Posts: 16
Joined: Tue Aug 24, 2010 10:09 pm
Location: CHI

RE: how to erase line on the plane

Postby mario » Tue Nov 23, 2010 11:14 pm

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*
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: RE: how to erase line on the plane

Postby bzxaggio » Wed Nov 24, 2010 7:21 pm

mario wrote: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!
bzxaggio
Active Member
 
Posts: 16
Joined: Tue Aug 24, 2010 10:09 pm
Location: CHI

RE: Re: RE: how to erase line on the plane

Postby maschoen » Wed Nov 24, 2010 9:28 pm

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm

RE: Re: RE: how to erase line on the plane

Postby mario » Wed Nov 24, 2010 11:32 pm

Asking about Pt and Pg means you haven`t done you`re homeword and read the documentation.
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: RE: Re: RE: how to erase line on the plane

Postby bzxaggio » Sun Nov 28, 2010 3:40 am

maschoen wrote: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.



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?
bzxaggio
Active Member
 
Posts: 16
Joined: Tue Aug 24, 2010 10:09 pm
Location: CHI

RE: Re: RE: Re: RE: how to erase line on the plane

Postby maschoen » Sun Nov 28, 2010 4:02 am

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.
maschoen
QNX Master
 
Posts: 2640
Joined: Wed Jun 25, 2003 5:18 pm


Return to GUI Programming

Who is online

Users browsing this forum: No registered users and 2 guests