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 MediaTracker class, using methods which can tell you when the image has fully arrived.
-
Another method is prepareImage(MyImage, this);
-
which returns a boolean that is true when image is fully downloaded.
|