|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--net.rim.device.api.system.Bitmap
Encapsulates a Bitmap graphic usable for display on the device.
When constructing a bitmap object, you have the option to specify the type of encoding used.
| Inner Class Summary | ||
static class |
Bitmap.PNGInfo
Provides additional information relevant for PNG bitmap graphics. |
|
| Field Summary | ||
static int |
COLUMNWISE_MONOCHROME
Columnwise, monochrome bitmap type. |
|
static int |
EXCLAMATION
Predefined bitmap used for alert dialogs. |
|
static int |
HOURGLASS
Predefined bitmap used for busy cursors. |
|
static int |
INFORMATION
Predefined bitmap used for information dialogs. |
|
static int |
QUESTION
Predefined bitmap used for query dialogs. |
|
static int |
TRUE_BLACK
|
|
static int |
TRUE_WHITE
|
|
| Constructor Summary | ||
Bitmap(int width,
int height)
Constructs a blank bitmap object. |
||
Bitmap(int type,
int width,
int height)
Constructs a blank bitmap object of a specific type. |
||
Bitmap(int type,
int width,
int height,
byte[] data)
Constructs a new bitmap of a specific type from existing data. |
||
| Method Summary | ||
static Bitmap |
createBitmapFromBytes(byte[] bytes,
int offset,
int length,
int scale)
Creates a bitmap from image data. |
|
static Bitmap |
createBitmapFromPNG(byte[] png,
int offset,
int length)
Creates a bitmap from provided PNG format data. |
|
boolean |
equals(Object obj)
Tests if provided bitmap is equal to this bitmap. |
|
static Bitmap |
getBitmapResource(String name)
Creates a bitmap from provided name resource. |
|
static Bitmap |
getBitmapResource(String module,
String name)
Creates a bitmap from provided named resource found in module. |
|
static int |
getDefaultType()
Query the default Bitmap type for the device. |
|
int |
getHeight()
Retrieves this bitmap's height. |
|
static Bitmap |
getPredefinedBitmap(int predefinedBitmap)
Retrieves one of the predefined system bitmaps. |
|
int |
getType()
Retrieves this bitmap's type. |
|
int |
getWidth()
Retrieves this bitmap's width. |
|
boolean |
hasAlpha()
Tests whether there is an alpha map associated with this Bitmap. |
|
boolean |
isWritable()
Indicates whether the Bitmap object is read-only. |
|
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int COLUMNWISE_MONOCHROME
This bitmap type indicates data is stored in pixel wide columns in successive bytes. Each bit in a byte is a pixel value, 0 is off and 1 is on. Uppermost pixels are in the less significant bits within a byte, and lower numbered bytes contain the uppermost pixels within a column.
| Constructor Detail |
public Bitmap(int width,
int height)
width - Width of this bitmap.height - Height of this bitmap.IllegalArgumentException - Thrown if width or height parameters are invalid.
public Bitmap(int type,
int width,
int height)
width - Width of this bitmap.height - Height of this bitmap.type - Type of this bitmap.IllegalArgumentException - Thrown if the width, height, or
the type is invalid.
public Bitmap(int type,
int width,
int height,
byte[] data)
Note that this method makes a copy of your provided bitmap data.
type - Type of this bitmap.width - Width of this bitmap.height - Height of this bitmap.data - Data from which to build this bitmap.IllegalArgumentException - Thrown if the length of the data array is
incorrect, the width or height are invalid, or the type is invalid.| Method Detail |
public static int getDefaultType()
public int getWidth()
public int getHeight()
public boolean isWritable()
Readonly bitmaps cannot be drawn to by attaching a Graphics object.
public static Bitmap createBitmapFromPNG(byte[] png, int offset, int length)
png - PNG data.offset - Start of PNG data in the passed byte array.length - Length of PNG data in the passed byte array: -1 means to
the end of the data array.OutOfMemoryError - Thrown if insufficient memory to process the PNG data
into a bitmap.NullPointerException - Thrown if the png parameter is null.IllegalArgumentException - Thrown if the png parameter is invalid, or
offset or length are invalid.public static Bitmap createBitmapFromBytes(byte[] bytes, int offset, int length, int scale)
The image can be optionally downscaled during decoding by an integer scale factor.
bytes - Image data.offset - Start of image data in the passed byte array.length - Length of image data in the passed byte array: -1 means to
the end of the data array.scale - Integer downscale factor: 1 means no scaling.OutOfMemoryError - If insufficient memory to process the image data
into a bitmap.NullPointerException - If the bytes parameter is null.IllegalArgumentException - If the bytes parameter is invalid,
offset or length are invalid, or scale is invalid.public boolean equals(Object obj)
A bitmap is equal to another if the types are the same, the dimensions are the same, and the data is the same.
obj - The object to compare to this bitmap.public boolean hasAlpha()
public static Bitmap getBitmapResource(String module, String name)
module - Name of the module containing the bitmap resource. If
not specified, the name of the calling module is used.name - Name of the bitmap resource.NullPointerException - If the name parameter is null.public static Bitmap getBitmapResource(String name)
This method looks for the resource in the cod file that launched this process.
name - Name of the bitmap resource.NullPointerException - If the name parameter is null.public static Bitmap getPredefinedBitmap(int predefinedBitmap)
predefinedBitmap - System graphic to retrieve. If you specify a
value not currently assigned to a standard system bitmap, this method
returns the INFORMATION bitmap.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2002 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.