Skip to main content



      Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » Erasing a Canvas
Erasing a Canvas [message #464694] Mon, 28 November 2005 16:41 Go to next message
Eclipse UserFriend
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 16:56 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 00:02:23 EDT 2025

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

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

Back to the top