Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Erasing a Canvas
Erasing a Canvas [message #464694] Mon, 28 November 2005 21:41 Go to next message
Igor is currently offline IgorFriend
Messages: 10
Registered: July 2009
Junior Member
hello,

I'm having a problem with my app., in which I use canvases. let's say that
i have a number drawn in one of the canvases thru GC graphics, and I need
to draw a new number in that specific canvas, but when i do so, i can
still see the former number drawn underneath the new one. Is it possible
to simply erase the content of a canvas....so it cannot be seen anymore
and I can draw new stuff on it???
(i checked out the API documentation a few times, but havent found any
methods how to do so....)

Thanks very much.
Best regards.

Igor Rohal
Re: Erasing a Canvas [message #464698 is a reply to message #464694] Mon, 28 November 2005 21:56 Go to previous message
Veronika Irvine is currently offline Veronika IrvineFriend
Messages: 1272
Registered: July 2009
Senior Member
1) Do all of your drawing in the Paint event.
2) Use Canvas.redraw to force an area to be repainted.

If you are using SWT.NO_BACKGROUND you will have to draw every pixel (i.e.
you will have to fill in the background too).

"Igor" <igor.dawg@gmail.com> wrote in message
news:70750548e66911805974cc53913ef19b$1@www.eclipse.org...
>
> hello,
>
> I'm having a problem with my app., in which I use canvases. let's say that
> i have a number drawn in one of the canvases thru GC graphics, and I need
> to draw a new number in that specific canvas, but when i do so, i can
> still see the former number drawn underneath the new one. Is it possible
> to simply erase the content of a canvas....so it cannot be seen anymore
> and I can draw new stuff on it???
> (i checked out the API documentation a few times, but havent found any
> methods how to do so....)
>
> Thanks very much.
> Best regards.
>
> Igor Rohal
>
Previous Topic:how to do a "table of tables"
Next Topic:Running an SWT Application With gcj
Goto Forum:
  


Current Time: Thu Dec 05 17:50:50 GMT 2019

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

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

Back to the top