Redrawing pixels to the screen in SWT-simple graphics prob [message #449615] |
Thu, 27 January 2005 14:22 |
Eclipse User |
|
|
|
Originally posted by: ncc98011.hotmail.com
Hi,
I can't seem to find a solution to my relatively basic problem.
I am creating an application that allows the user to draw open shapes like
ellipses and rectangles on top of a photo (for an example- open up ms paint,
open a photo and draw a circle on it - this is what I am trying to achieve).
I am using an SWT Canvas, and am loading an image into the Canvas. I can
place markings (shapes) on this image, I can zoom and I can scroll. No
problems there.
However, now I would like to be able to delete a particular drawn shape from
the screen.
Now in most applications, you could use XOR and if the background was white,
you could redraw over a black shape with a white one of the exact same size,
and it would give the appearance of being deleted. But my background is a
photograph, so is there any drawingMode I can use to delete a
rectangle/ellipse shape from screen? e.g. a red circle place on a photo?
At the moment, I have to use a very inefficient technique whereby; if I need
to delete circle3 from the photo, I delete it from the array of stored
circles, redraw the photo to the screen (thereby destroying all markings),
then redraw circle1 and circle 2 to the screen. This is a contrived example,
but hopefully it will clarify. In my app the scale and complexity is much
larger, and it can become *very* inefficient to use this technique all the
time!
Hope my problem is clear.
Thanks for any help or advice at all
Colin
|
|
|
Powered by
FUDForum. Page generated in 0.01739 seconds