Erasing a Canvas [message #464694] |
Mon, 28 November 2005 16:41  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
>
|
|
|
Powered by
FUDForum. Page generated in 0.03485 seconds