HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 1 February 97

Foil 21 Image Downloading -- imageObserver, MediaTracker

From Jan 29 Delivered Lecture for Course CPS616 -- Java Lecture 3 -- Exceptions Through Events CPS616 spring 1997 -- Jan 29 1997. by Nancy McCracken * See also color IMAGE
Secs 56.1
When drawImage is called, it draws only the pixels of the image that are already available.
Then it creates a thread for the imageObserver. Whenever more of the image becomes available, it activates the method imageUpdate, which in turn which call paint and drawImage, so that more of the image should show on the screen.
The default imageUpdate doesn't work if you are double buffering the window in which the image appears.
More control over showing the image as it downloads can be obtained by working with the imageObserver class and the new MediaTracker class, using methods which can tell you when the image has fully arrived.


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 Sun Feb 16 1997