Motorola C450, C550, C370 PalleteImage Class, PalleteImage Constructor, PalleteImage Methods

Page 46

}

}

PalleteImage Class

PaletteImage provides methods for manipulating the color palette data of an image. PaletteImages can only be created with palette-based image data (PNG color type 3, or other palette image formats that a particular device may support).

A single palette entry or the entire palette can be retrieved as a series of RGB values in 0xRRGGBB format (MIDP color format). The effects of the palette changes will be visible in the next Image that is generated.

The following will be supported:

Single color transparency: the entire palette may be fully opaque, or a single palette entry may be designated as being fully transparent. Alpha channels are not supported.

Once the palette entries have been set to the desired values, a MIDP Image object is retrieved that reflects the new palette settings.

PalleteImage Constructor

The PalleteImage class defines the following constructors:

PalleteImage(byte[] data, int offset, int length) throws IOException - Creates a new PalleteImage using the provided image data.

PalleteImage (java.lang.String name) throws IOException -

Creates a new PaletteImage using the provided image data in a named resource.

PalleteImage Methods

The PalleteImage class defines the following methods:

public Image getImage() - Creates and returns a new Image object using this PaletteImage. The Image returned will reflect the PaletteImage’s original pixel data and current palette data. This method enables the developer to easily generate a series of differently colored images by adjusting palette data.

public int getTransparentIndex() – Gets the current transparent index. Pixels that reference the transparent index in the palette are not drawn when the image is rendered. By default, the transparent index is -1 even if a transparent color is specified in the original image data.

Image 46
Contents Technical Manual Table of Contents Lcdui JAD Attributes Audience IntroductionPurpose DisclaimerReferences Date Name Reason Revision HistoryDefinitions, Abbreviations, Acronyms Acronym DescriptionDocument Overview Introduction J2ME Introduction Java 2 Platform, Micro Edition J2MEMotorola J2ME Platform Resources AvailableFile & RMS Description DisplayNetworking Java VMGuide to Development in J2ME Developing and Packaging J2ME ApplicationsIntroduction to Development Page Installation OTA ProcedureDownloading Applications Program and Data space notes Starting Applications Java Application Installer/De-Installer JaidExiting Applications Launching Web Session for Http Download Error ChecksDownloading MIDlets 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 FormatUDP Sockets TCP SocketsImplementation Notes Network API Lcdui DescriptionLcdui Functional Description Gaming API and SoundClass Hierarchy BackgroundMusic Methods Using BackgroundMusicBackgroundMusic Class Gaming API containing a sound APIGameScreen Class GameScreen FieldsGameScreen Methods Public int getKeyStatesInformation, disabling key events can improve performance Using GameScreen GameScreenImageUtil Fields ImageUtil ClassImageUtil Methods Using ImageUtil RgbDataPalleteImage Constructor PalleteImage ClassPalleteImage Methods Using PalleteImage Public void setTransparentIndexint index throwsUsing Static and Animated Tiles PlayField ClassDefining View Windows Using SpritesPlayField Constructor 2N+1 2N + PlayField Methods Public void addSpriteSprite s throwsPage Public boolean collidesWithAnyTileSprite s throws Using PlayField PlayFieldSprite Class Using SoundEffectSoundEffect Class SoundEffect MethodsSprite Drawing Animation FramesSprite Constructor Sprite Methods Page Public final void drawGraphics g throws FileFormatNotSupportedException Using SpriteSprites FileFormatNotSupportedException Constructors Java Gaming Sound APIMax Midi Extension Support 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 Code Examples Record Management SystemClass Description 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 SheetsDocumentation Motorola Developer Information ToolsReferences Purchase Motorola Developer Information Tools Motorola, Inc
Related manuals
Manual 110 pages 1.04 Kb