CH 1
CH 1
IMAGE
CONTENT
● Introduction
● The java.awt.Image Class
● The java.awt.image.BufferedImage Class
● Reading/Loading an Image
● Drawing an Image
● Demonstrations
● Teach yourself
● Creating and drawing an image
● Writing/Saving an image
INTRODUCTION
Image tasks:
● Loading an external GIF, PNG JPEG image format file into the
internal image representation used by Java 2D.
● Directly creating a Java 2D image and rendering to it.
● Drawing the contents of a Java 2D image onto a drawing
surface.
● Saving the contents of a Java 2D image to an external GIF,
PNG, or JPEG image file.
INTRODUCTION
● The are two main classes that you must learn about to work with images:
● java.awt.Image
● java.awt.image.BufferedImage
java.awt.Image CLASS
java.awt.Image CLASS
java.awt.Image CLASS
java.awt.image.BufferedImage
● The Raster performs the following functions:
● Represents the Descartes coordinates of the image
● Maintains image data in memory
● Provides a mechanism for creating multiple subimages from a single image data
buffer
● Provides methods for accessing specific pixels within the image
DEMO