HELP! * GREY=local LOCAL HTML version of Foils prepared July 10 1996

Foil 152 Double Buffering to Reduce Flicker - I

From Basic Lectures on Java Language Applets Graphics Networking Trip to China and Icase Tutorial -- July 12-28 and June 10-13 96. by Geoffrey C. Fox * See also color IMAGE

Here you have two "graphics contexts" (frame buffers of the size of the applet), and you construct the next image for an animation "off-line" in the second frame buffer.
This frame buffer is then directly copied to the main applet Graphics object without clearing image as in default update()
In init(), you would create the frame buffer:
  • Image OffscreenImage; // Place to hold Image
  • Graphics offscreenGraphics; /* The second graphics context of offscreenImage */
  • offscreenImage = createImage(width,height);
  • offscreenGraphics = offscreenImage.getGraphics();



Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Feb 18 1997