This post originated from an RSS feed registered with Java Buzz
by Fred Grott.
Original Post: DoubleBuffering-J2ME
Feed Title: ShareMe Technologies-The Mobile Future
Feed URL: http://sedoparking.com/search/registrar.php?domain=®istrar=sedopark
Feed Description: A Weblog about Java programming and digital convergence on mobile devices in such areas as P2P and collaborative technology. Old Archive .
Hmm, it seems I promised some snippets of code this week to show examples
of stuff I am coding. Okay here is small snippet of DoubleBuffering fromt
he paint and paintScreen mthods:
public void paintScreen(Graphics g){
g.setClip(x, y, width, height): g.drawImage(Cache.imageBuffer,
x-frame*width, y, Graphics.TOP | Graphics.LEFT): g.setClip(0,
0, SplashCanvas.getMeWidth(), SplashCanvas.getMeHeight());
}
There is a little more detail than this but you get the general idea. In
other area of your class you are first setting the Cache.ImageBuffer to
the image and checking for isDoubleBuffered and using those if statements
to either use the paintScreen(g) or paintScreen(gc) after you set gc with
gc=ImageBuffer.getGraphics().