文档

Java™ 教程-Java Tutorials 中文版
Java2D 中的高级主题
Trail: 2D Graphics

课程:Java2D 中的高级主题

This lesson shows you how to use Graphics2D to display graphics with fancy outline and fill styles, transform graphics when they are rendered, constrain rendering to a particular area, and generally control the way graphics look when they are rendered. You'll also learn how to create complex Shape objects by combining simple ones and how to detect when the user clicks on a displayed graphics primitive. These topics are discussed in the following sections:

转换形状,文本和图像

This section shows you how to modify the default transformation so that objects are translated, rotated, scaled, or sheared when they are rendered.

剪切绘图区域

You can use any shape as a clipping path--the area within which rendering takes place.

合成图形

This section illustrates the various compositing styles supported by AlphaComposite and shows you how to set the compositing style in the Graphics2D rendering context.

控制渲染质量

This section describes the rendering hints that Graphics2D supports and shows you how to specify your preference in the trade-off between rendering quality and speed.

从几何图元构造复杂形状

This section shows you how to perform boolean operations on Shape objects using the Area class.

支持用户交互

This section shows you how to perform hit detection on graphics primitives.


Previous page: Previous Lesson
Next page: Transforming Shapes, Text, and Images