Chapter 12. Devices

The 2D API is centered around the task of rendering shapes, text, and images on an output device, usually a monitor or a printer. One of the goals of the API is to make the rendering process the same, regardless of the output device. Sometimes, though, you want information unique to a specific device. For performance reasons, you might want to know the data format of a monitor so you can create compatible images for fast rendering. Whatever the reason, the 2D API has several classes that provide information about the local graphics capabilities. The 2D API describes three concepts:

Environment

An environment describes the overall graphics capabilities of a particular computer, including the available fonts and screen devices.

Device

A device is a monitor or printer.

Configuration

Devices can be set up in more than one way. For example, many video adapters are capable of displaying different screen resolutions and different color resolutions. (Color resolution is the number of bits per pixel (bpp) that are used to represent color.)

Get Java 2D Graphics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.