New for MIDP 2.0
 | We have marked a number of topics in this chapter as New! with an icon in the book margin. Here is a summary of the most important new low-level user interface features of MIDP 2.0. |
The low-level user interface has been improved to allow more control and easier programming of Canvas and Image level actions. Significant additions are support for alpha blending and for manipulating Images as arrays of pixel values.
The Canvas class has been changed as follows:
A full screen mode has been added that allows the maximum display to be used for application graphics (see the setFullScreenMode method.) The methods for setting the Ticker and title have been moved to Displayable so that these features can be used in Canvas objects as well.
The Graphics class has been improved with:
the ability to draw a rectangular portion of the source Image with image transformation including rotation and mirroring (see the drawRegion method), the ability to copy of pixels within an off-screen Image (see the copyArea method), the ability to fill triangles, which is useful when filling irregularly shaped areas (see the fillTriangle method), the ability to draw pixels into the Image from an array of RGB pixel values, possibly with alpha values (see the drawRGB method), and the ability to return the color that will be used in the display (see the getDisplayColor method).
The Image class has been extended to allow easier creation of Image objects by adding methods for:
creating an Image from a subregion of an existing Image and with a specified rotation and mirroring transform (see the appropriate createImage method), creating an immutable Image from an InputStream (support for PNG input streams is required; see the createImage(InputStream) method), creating an immutable Image from an array of RGB values, possibly with alpha values (see the createRGBImage method), and retrieving the RGB and alpha pixels values from an Image as an array (see the getRGB method).
|