Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Redrawing pixels to the screen in SWT-simple graphics prob
Redrawing pixels to the screen in SWT-simple graphics prob [message #449615] Thu, 27 January 2005 14:22
Eclipse UserFriend
Originally posted by:


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

Hope my problem is clear.

Thanks for any help or advice at all

Previous Topic:error when using eclipse with Suse 9.2
Next Topic:Browser widget: Popup Blocking with VisibilityWindowListener or OpenWindowListener?
Goto Forum:

Current Time: Wed May 27 07:25:09 GMT 2020

Powered by FUDForum. Page generated in 0.77040 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top