Deleting and erasing lines [message #10484] |
Thu, 11 December 1997 00:00  |
Andrew A. Baker
Messages: 2 Registered: December 1997
|
Junior Member |
|
|
Hello,
I'm a fairly new user of pv-wave and I'm trying to do something which
I am sure will be very simple to more experienced pv-wave users.
I wish to draw a line on top of an image which follows the cursor as
the mouse is moved and continously updates the line on the screen
(after, of course, an initial point has been chosen). Drawing the
line is easy using PLOTS, but how do I erase it and leave the original
image intact? I don't wish to redraw the entire image, of course, for
speed reasons.
The best method that I know from other programming endeavours is to use
XOR (exclusive-OR), so that the colour drawn depends on the colour
already there and reversal (i.e. erasing the line) is then a trivial
process. I don't need a line of one colour only, so is there a way of
doing non-absolute colours? Or is there a better way?
Thanks in advance for any help.
Andy.
------------------------------------------------------------ ------------
Email: andy.baker@bristol.ac.uk H.H. Wills Physics Laboratory
Tel: +44 (0)117 928 9000 ext 8743 (office) University of Bristol
+44 (0)117 928 8747 (lab/messages) Bristol
Fax: +44 (0)117 925 5624 BS8 1TL
Web: http://teddy.phy.bris.ac.uk/~phaab/ UNITED KINGDOM
------------------------------------------------------------ ------------
|
|
|
Re: Deleting and erasing lines [message #10577 is a reply to message #10484] |
Fri, 12 December 1997 00:00  |
Andrew A. Baker
Messages: 2 Registered: December 1997
|
Junior Member |
|
|
M. Hegde wrote:
>
> David Fanning (davidf@dfanning.com) wrote:
> : Andrew A. Baker (andy.baker@bristol.ac.uk) writes:
Thanks guys, problem solved!
For those interested, David sent me an e-mail which included the
crucial line:
Device, Set_Graphics_Function=6
to switch to XOR mode.
It's as easy as that!!
Andy.
------------------------------------------------------------ ------------
Email: andy.baker@bristol.ac.uk H.H. Wills Physics Laboratory
Tel: +44 (0)117 928 9000 ext 8743 (office) University of Bristol
+44 (0)117 928 8747 (lab/messages) Bristol
Fax: +44 (0)117 925 5624 BS8 1TL
Web: http://teddy.phy.bris.ac.uk/~phaab/ UNITED KINGDOM
------------------------------------------------------------ ------------
|
|
|
Re: Deleting and erasing lines [message #10578 is a reply to message #10484] |
Thu, 11 December 1997 00:00  |
hegde
Messages: 17 Registered: December 1995
|
Junior Member |
|
|
David Fanning (davidf@dfanning.com) wrote:
: Andrew A. Baker (andy.baker@bristol.ac.uk) writes:
: > The best method that I know from other programming endeavours is to use
: > XOR (exclusive-OR), so that the colour drawn depends on the colour
: > already there and reversal (i.e. erasing the line) is then a trivial
: > process. I don't need a line of one colour only, so is there a way of
: > doing non-absolute colours? Or is there a better way?
: The XOR method is fast and easy. It just doesn't look all
: that great normally. The reason is that it will only work
In addition to this, if you use XOR mode the line will be visible all the time.
If you don't need a line of "one colour only", I would suggest XOR mode.
Else if you are specific about the line color,
1) keep the entire image in a pixmap and copy it to window each time after
before drawing the line.
OR
2) copy the image enclosed in the line's bounding rectangle to pixmap and copy
it back before drawing the line.
-M. Hegde
|
|
|