Motorola C370, C550, C450 technical manual ImageUtil Class, ImageUtil Fields, ImageUtil Methods

Page 44

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

Image 44
Contents Technical Manual Table of Contents Lcdui JAD Attributes Introduction PurposeAudience DisclaimerReferences Revision History Definitions, Abbreviations, AcronymsDate Name Reason Acronym DescriptionDocument Overview Introduction J2ME Introduction Java 2 Platform, Micro Edition J2MEMotorola J2ME Platform Resources AvailableDescription Display NetworkingFile & RMS Java VMIntroduction to Development Developing and Packaging J2ME ApplicationsGuide to Development in J2ME Page Downloading Applications OTA ProcedureInstallation Program and Data space notes Exiting Applications Java Application Installer/De-Installer JaidStarting Applications Downloading MIDlets Error ChecksLaunching Web Session for Http Download XML Screen Renderings BombMan is back, now on your Taichi series of handsets Taichi handset New Games Application Management MIDlet LifecycleMIDlet Suite Installation MIDlet Suite De-installation MIDlet Suite Updating DestroyAppMethod Caller PurposeStartApp or the pauseApp Using startApp Java System MIDlet Control of MIDlet State TransitionsPage Network API Network ConnectionsClass Descriptions IOException when it detects a time-out condition URL FormatImplementation Notes TCP SocketsUDP Sockets Network API Lcdui DescriptionLcdui Class Hierarchy Gaming API and SoundFunctional Description Using BackgroundMusic BackgroundMusic ClassBackgroundMusic Methods Gaming API containing a sound APIGameScreen Class GameScreen Fields GameScreen Methods Public int getKeyStatesInformation, disabling key events can improve performance Using GameScreen GameScreenImageUtil Methods ImageUtil ClassImageUtil Fields Using ImageUtil RgbDataPalleteImage Methods PalleteImage ClassPalleteImage Constructor Using PalleteImage Public void setTransparentIndexint index throwsUsing Static and Animated Tiles PlayField ClassPlayField Constructor Using SpritesDefining View Windows 2N+1 2N + PlayField Methods Public void addSpriteSprite s throwsPage Public boolean collidesWithAnyTileSprite s throws Using PlayField PlayFieldUsing SoundEffect SoundEffect ClassSprite Class SoundEffect MethodsSprite Constructor Animation FramesSprite Drawing Sprite Methods Page Public final void drawGraphics g throws Sprites Using SpriteFileFormatNotSupportedException Java Gaming Sound API Max Midi Extension SupportFileFormatNotSupportedException Constructors Java Gaming Sound APIVibe and Backlight Vibe and Backlight APIOverview Creating a MessageSending a Message PermissionsJAD Attributes JAD AttributesMandatory attributes for manifest files MIDlet-Name Record Management System Class DescriptionCode Examples RecordStoreTips CaveatsPhonebook Access Phonebook Access APIPhonebook Access API Permissions Sample of code to create object of PhoneBookRecord classSimmemory Sample of code for calling of ‘getMaxEmailLength ’ method Sample of code for calling of ‘isPrimaryint speedNo’ method Sample of code for calling of ‘getNumberCategories’ method Sample of code for calling of ‘setCategoryView’ method Sample of code for calling of ‘getUsedRecords’ method Int index = ReceivedRecord.getRecord1 ITAP Intelligent Keypad Text Entry APIAppendix a Key Mapping Key Mapping for the C370, C450, and C550Center Select END Appendix B Memory Management Calculation Available MemoryOnline FAQ Appendix CAppendix D Spec Sheets C370, C450, and C550 Spec SheetsReferences Purchase Motorola Developer Information ToolsDocumentation Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb