Text in Canvas with Scrollbar
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   bomsetty_Naveen
Posted On:   Wednesday, April 4, 2001 05:07 AM

I added a Scroll bar to a Canvas and painted some Text on the Canvas.When i try to scroll the text is getting cleared.what could be the reason for this.

Re: Text in Canvas with Scrollbar

Posted By:   Finlay_McWalter  
Posted On:   Thursday, June 14, 2001 10:02 PM

You should be drawing the text in the paint() and repaint() methods of your subclass of canvas. These methods are called when the canvas is exposed or scrolled.


If you're drawing something that changes dynamically (e.g. if you're writing a drawing program) then you may want instead to draw the text into an offscreen image. Then have the paint() and repaint() methods on the canvas drawImage that offscreen image.

About | Sitemap | Contact