
Working with Images • 709
imageUpdate method is called and output is shown. The applet window is not shown as it is simply a
blank window. The output shows the width and height of the image fi le ‘jc.gif ’. From third line onwards,
output appears due to the following line in the imageUpdate method:
if ((flags & SOMEBITS) != 0)
System.out.println(“Image section :” + new Rectangle(x, y,
width, height));
Our image observer reads one section of the image at a time starting from x = 0, y = 0, width = 16 and height
=1. Only the y parameters vary from 0 to 15 (height-1).
When the image is loaded in the end, the “Image finished!” is displayed. ...