|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.rim.device.api.system.EncodedImage
|
+--net.rim.device.api.system.JPEGEncodedImage
Represents an image encoded in the JPEG format.
To create a JPEGEncodedImage 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:
If done correctly, the file will contain a valid Java byte array containing the image encoding.
EncodedImage| Field Summary | ||
|
static int |
FILETYPE_EXIF
Constant indicating the EXIF file type. |
|
static int |
FILETYPE_JFIF
Constant indicating the JFIF file type. |
|
static int |
FILETYPE_SPIFF
Constant indicating the SPIFF file type. |
|
static int |
FILETYPE_UNKNOWN
Constant indicating an unknown file type. |
|
static int |
FRAMETYPE_BASELINE
Constant indicating the baseline jpeg mode. |
|
static int |
FRAMETYPE_PROGRESSIVE
Constant indicating the progressive jpg mode. |
|
static int |
FRAMETYPE_SEQUENTIAL
Constant indicating the sequential jpeg mode . |
| 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_JPEG, IMAGE_TYPE_PNG, IMAGE_TYPE_TIFF, IMAGE_TYPE_WBMP |
| Method Summary | ||
|
static JPEGEncodedImage |
encode(Bitmap bitmap,
int quality)
Creates a JPEGEncodedImage from a Bitmap. |
|
int |
getAlphaType(int frameIndex)
Returns the Alpha type. |
|
int |
getBitmapType(int frameIndex)
Returns the default bitmap type of the given frame. |
|
int |
getFileType()
Returns an integer representing the file type. |
|
int |
getFrameType()
Returns an integer representing the frame type. |
|
String |
getMIMEType()
Return the commonly known MIME type associate for this encoded image object. |
|
boolean |
isColor()
Returns a boolean indicating whether or not the jpeg is color. |
|
static boolean |
isJPEGSupported()
Returns whether or not the device's software supports the JPEG image format. |
| Methods inherited from class net.rim.device.api.system.EncodedImage |
createEncodedImage, createEncodedImage, getBitmap, getBitmap, getData, getDecodeMode, getEncodedImageResource, getEncodedImageResource, getFrameCount, getFrameHeight, getFrameMonochrome, getFrameTransparency, getFrameWidth, getHeight, getImageType, getLength, getMetaData, getOffset, getScale, getScaledFrameHeight, getScaledFrameWidth, getScaledHeight, getScaledWidth, getScaleX32, getScaleY32, getSupportedMIMETypes, getWidth, hasTransparency, isMIMETypeSupported, isMonochrome, scaleImage32, setDecodeMode, setScale |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FILETYPE_EXIF
public static final int FILETYPE_JFIF
public static final int FILETYPE_SPIFF
public static final int FILETYPE_UNKNOWN
public static final int FRAMETYPE_BASELINE
public static final int FRAMETYPE_PROGRESSIVE
public static final int FRAMETYPE_SEQUENTIAL
| Method Detail |
public static JPEGEncodedImage encode(Bitmap bitmap, int quality)
JPEGEncodedImage from a Bitmap.bitmap - The Bitmap to be encoded into JPEG format.quality - The quality that will be used to encode the Bitmap; valid values
are between 0 (lowest quality) and 100 (highest quality), inclusive.JPEGEncodedImage object that is the specified
Bitmap encoded in JPEG format with the specified quality setting.NullPointerException - if bitmap is null.IllegalArgumentException - if quality is outside the valid range.public int getAlphaType(int frameIndex)
Note that since JPGs never have alpha channels, this method will always return 0.
getAlphaType in class EncodedImageframeIndex - The index of the frame.public int getBitmapType(int frameIndex)
getBitmapType in class EncodedImageframeIndex - The index of the frame for which to return the type.public int getFileType()
One of FILETYPE_UNKNOWN, FILETYPE_JFIF.
public int getFrameType()
One of FRAMETYPE_BASELINE, FRAMETYPE_SEQUENTIAL, FRAMETYPE_PROGRESSIVE.
public String getMIMEType()
getMIMEType in class EncodedImageString representing the MIME type generally associated with this object.public boolean isColor()
public static final boolean isJPEGSupported()
true if the device's software supports the JPEG image format or
false if the device's software does not support the JPEG image format.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2008 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.