1 |
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.
|
2 |
This frame buffer is then directly copied to the main applet Graphics object without clearing image as in default update()
|
3 |
In init(), you would create the frame buffer:
-
Image OffscreenImage; // Place to hold Image
-
Graphics offscreenGraphics; /* The second graphics context of offscreenImage */
-
offscreenImage = createImage(getSize().width,getSize().height);
-
offscreenGraphics = offscreenImage.getGraphics();
|