0% found this document useful (0 votes)
21 views12 pages

CH 1

This document discusses working with images in Java. It introduces the java.awt.Image and java.awt.image.BufferedImage classes, which are the main classes used to load, draw, and save images. It also covers reading images from files, drawing images, and creating and saving in-memory images. Examples are provided to demonstrate loading an image, drawing it, and saving images that are created programmatically.

Uploaded by

Kay Triệu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views12 pages

CH 1

This document discusses working with images in Java. It introduces the java.awt.Image and java.awt.image.BufferedImage classes, which are the main classes used to load, draw, and save images. It also covers reading images from files, drawing images, and creating and saving in-memory images. Examples are provided to demonstrate loading an image, drawing it, and saving images that are created programmatically.

Uploaded by

Kay Triệu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Graphic-Image

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

You might also like