next up previous
Next: The Java Color Up: Interactive Textbooks; Embedding Image Previous: Background

Java's Image Processing Support

JAVA offers a variety of functions dedicated to the manipulation of images, as well a Graphics class which implements the usual set of drawing primitives. The support for using images is spread out between the java.applet, java.awt and java.awt.image packages. The latter package contains the support for manipulating images that have been already loaded. The loading of an image is achieved through the getImage() method (ie. a subroutine or function) of an Applet instance (ie. the Applet might be attached to execute in more than one place independently) by supplying a URLgif parameter (ie. the path name of the image to be loaded).

To display an image one invokes the drawImage() method of the Graphics object which is passed to the applet's update() or paint() method. One can keep track of the state of the image(s) using an instance of a MediaTracker class and use the methods provided. The ImageObserver interface can be used for even closer monitoring of an image.





Bob Fisher
Fri Jul 4 16:11:50 BST 1997