tailieunhanh - Card đồ họa trong Java

Tham khảo tài liệu 'card đồ họa trong java', công nghệ thông tin, hệ điều hành phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | JAVA 2D GRAPHICS IN JAVA 2 Topics in This Chapter Drawing 2D shapes Tiling an image inside a shape Using local fonts Drawing with custom pen settings Changing the opaqueness of objects Translating and rotating coordinate systems Chapter 10 Anyone who has even lightly ventured into developing detailed graphical programs with the Abstract Windowing Toolkit AWT has quickly realized that the capabilities of the Graphics object are rather limited not surprisingly since Sun developed the AWT over a short period when moving Java from embedded applications to the World Wide Web. Shortcomings of the AWT include limited available fonts lines drawn with a single-pixel width shapes painted only in solid colors and the inability to properly scale drawings prior to printing. Java 2D is probably the second most significant addition to the Java 2 Platform surpassed only by the Swing GUI components. The Java 2D API provides a robust package of drawing and imaging tools to develop elegant professional high-quality graphics. The following important Java 2D capabilities are covered in this chapter Colors and patterns graphics can be painted with color gradients and fill patterns. Transparent drawing opaqueness of a shape is controlled through an alpha transparency value. Local fonts all local fonts on the platform are available for drawing text. Explicit control of the drawing pen thickness of lines dashing patterns and segment connection styles are available. Transformations of the coordinate system translations scaling rotations and shearing are available. 359 360 Chapter 10 Java 2D Graphics in Java 2 These exciting capabilities come at a price the Java 2D API is part of the Java Foundation Classes introduced in Java 2. Thus unlike Swing which can be added to the JDK you cannot simply add Java 2D to the JDK . The Java Runtime Environment JRE for the Java 2 Platform is required for execution of 2D graphical applications and a Java 2-capable browser or the Java Plug-In covered