net.rim.device.api.system
Class WBMPEncodedImage

java.lang.Object
  extended by net.rim.device.api.system.EncodedImage
      extended by net.rim.device.api.system.WBMPEncodedImage

public final class WBMPEncodedImage
extends EncodedImage

Represents an image encoded in the Windows Bitmap (WBMP) format.

To create a WBMPEncodedImage instance, use the EncodedImage.createEncodedImage(byte[],int,int) method. The createEncodedImage method accepts a java byte array containing the encoding of an image.

An image encoding can be obtained by either of the following methods:

First, when an image is added to a project in the IDE, the image resource becomes available to the developer.

Second, the image encoding can be obtained manually by converting the binary image file to a java byte array. This is accomplished using the following procedure:

  1. Using a binary file converter, such as xxd, convert the image to a C-style byte array.
  2. Open the target file and search for the string "0x".
  3. Replace the string with the following "(byte)0x".
  4. Adjust the array declaration at the top of the file to conform to Java standards.
  5. Remove the following string from the bottom of the file "unsigned int input_file_name_len = XXXX".

If done correctly, the file will contain a valid java byte array containing the image encoding.

Since:
BlackBerry API 3.6.0

Field Summary
 
Fields inherited from class net.rim.device.api.system.EncodedImage
DECODE_ALPHA, DECODE_NATIVE, DECODE_NO_DITHER, DECODE_READONLY, IMAGE_TYPE_BMP, IMAGE_TYPE_GIF, IMAGE_TYPE_ICO, IMAGE_TYPE_JPEG, IMAGE_TYPE_PNG, IMAGE_TYPE_TIFF, IMAGE_TYPE_WBMP
 
Method Summary
 int getAlphaType(int frameIndex)
          Gets the bitmap type for the given frame's alpha channel.
 int getBitmapType(int frameIndex)
          Gets the bitmap type for the given frame.
 String getMIMEType()
          Return the commonly known MIME type associate for this encoded image object.
 int getType()
          Returns the WBMP image type.
 
Methods inherited from class net.rim.device.api.system.EncodedImage
createEncodedImage, createEncodedImage, getBitmap, getBitmap, getData, getDecodeMode, getEncodedImageResource, getEncodedImageResource, getFrameCount, getFrameHeight, getFrameMonochrome, getFrameTransparency, getFrameWidth, getHeight, getImageHeight, getImageType, getImageWidth, getLength, getMetaData, getOffset, getScale, getScaleX32, getScaleY32, getScaledFrameHeight, getScaledFrameWidth, getScaledHeight, getScaledHeight, getScaledWidth, getScaledWidth, getSupportedMIMETypes, getWidth, hasTransparency, isAnimated, isMIMETypeSupported, isMonochrome, scaleImage32, setDecodeMode, setScale
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Method Detail

getAlphaType

public int getAlphaType(int frameIndex)
Description copied from class: EncodedImage
Gets the bitmap type for the given frame's alpha channel.

Specified by:
getAlphaType in class EncodedImage
Parameters:
frameIndex - The index of the frame for which to return the alpha channel.
Returns:
The type of alpha bitmap that will be decoded with a call to getBitmap. If the given frame doesn't have an alpha bitmap, it will return 0
Since:
BlackBerry API 3.7.0

getBitmapType

public int getBitmapType(int frameIndex)
Description copied from class: EncodedImage
Gets the bitmap type for the given frame.

Specified by:
getBitmapType in class EncodedImage
Parameters:
frameIndex - The index of the frame for which to return the bitmap type.
Returns:
The type of bitmap that will be decoded with a call to getBitmap.
Since:
BlackBerry API 3.7.0

getMIMEType

public String getMIMEType()
Return the commonly known MIME type associate for this encoded image object.

Specified by:
getMIMEType in class EncodedImage
Returns:
A String representing the MIME type generally associated with this object.
Since:
BlackBerry API 4.2.0

getType

public int getType()
Returns the WBMP image type.

Returns:
The WBMP image type.
Since:
BlackBerry API 3.6.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.