Motorola J2ME Specifications Page 44

  • Download
  • Add to my manuals
  • Print
  • Page
    / 86
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 43
ImageUtil Class
ImageUtil provides static methods useful to the manipulation of Image objects.
Specifically, it provides methods for setting and getting RGB values, and also provides the
ability to create a scaled instance of an existing
Image.
ImageUtil Fields
The ImageUtil class defines the following fields:
public static final int SCALE_AREA - Area scaling method.
public static final int SCALE_REPLICATE - Replicate scaling method.
public static final int SCALE_SMOOTH - Smooth scaling method.
ImageUtil Methods
The ImageUtil class defines the following methods:
public static void getPixels(Image src, int x, int
y, int width, int height, int[] rgbData) throws
ArrayIndexOutOfBoundsException – Gets RGB pixel data from the
specified region of the source image. The data is stored in the provided int array in
row-major order using the standard 24-bit color format (0xRRGGBB). Note that the
color information stored in the image may be subject to the capabilities of the device's
display. The
rgbData must be instantiated previously calling this method, according
to pixel amount that the user is requiring to the method. The parameters are the
following:
src - the source Image to retrieve the pixel data from; x - the horizontal
location of left edge of the region;
y - the vertical location of the top edge of the
region;
width - the width of the region; height - the height of the region; height
- the height of the region; and
rgbData - the array in which the pixel data is to be
stored.
public static void getPixels(Image src,
int[] rgbData) throws ArrayIndexOutOfBoundsException
Gets RGB pixel data from the entirety of the source image. The data is stored in the
provided int array in row-major order using the standard 24-bit color format
(0xRRGGBB). Note that the color information stored in the image may be subject to
the capabilities of the device's display. The
rgbData must be instantiated previously
calling this method, according to pixel amount that the user is requiring to the
method. The parameters are the following:
src - the source Image to retrieve the
pixel data from; and
rgbData - the array in which the pixel data is to be stored.
public static void setPixels(javax.microedition.lcdui.Image dest, int x, int y, int width,
int height, int[] rgbData) throws ArrayIndexOutOfBoundsException,
IllegalArgumentException – Sets RGB pixel data in specified region of the destination
image. The data must be stored in the int array in row-major order using the standard
Page view 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 85 86

Comments to this Manuals

No comments