|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.ui.image.Image
public abstract class Image
Represents an image of agnostic type that can be painted into a graphics context.
Recommended for containers or components that would like to support and display
different types of images, e.g. Bitmap
,
BMPEncodedImage
,
PNGEncodedImage
, etc. An image
cannot be instantiated directly. Different types of images can be created by calling
the following methods in the ImageFactory
:
Field Summary | ||
---|---|---|
static int |
BOTTOM
The image will be painted at the bottom of the graphics context. |
|
static int |
HCENTER
The image will be centered vertically in the graphics context. |
|
static int |
LEFT
The image will be left-justified in the graphics context. |
|
static int |
RIGHT
The image will be right-justified in the graphics context. |
|
static int |
TOP
The image will be painted at the top of the graphics context. |
|
static int |
VCENTER
The image will be centered vertically in the graphics context. |
Method Summary | ||
---|---|---|
abstract int |
getHeight(int width,
int height)
Returns the height of the painted image for the specified region. |
|
abstract int |
getWidth(int width,
int height)
Returns the width of the painted image for the specified region. |
|
abstract void |
paint(Graphics graphics,
int x,
int y,
int width,
int height)
Paints the image in the given graphics context starting at (x, y) with provided width and height. |
|
abstract void |
paint(Graphics graphics,
int x,
int y,
int width,
int height,
int style)
Paints the image in the given graphics context starting at (x, y) with provided width and height. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TOP
public static final int VCENTER
public static final int BOTTOM
public static final int LEFT
public static final int HCENTER
public static final int RIGHT
Method Detail |
---|
public abstract int getHeight(int width, int height)
width
- The width of the available region for this image.height
- The height of the available region for this image.
IllegalArgumentException
- if width
or
height
is less than 1.public abstract int getWidth(int width, int height)
width
- The width of the available region for this image.height
- The height of the available region for this image.
IllegalArgumentException
- if width
or
height
is less than 1.public abstract void paint(Graphics graphics, int x, int y, int width, int height)
graphics
- Graphics context to paint into.x
- x drawing offset.y
- y drawing offset.width
- Desired width of the image.height
- Desired height of the image.public abstract void paint(Graphics graphics, int x, int y, int width, int height, int style)
graphics
- Graphics context to paint into.x
- x drawing offset.y
- y drawing offset.width
- Desired width of the image.height
- Desired height of the image.style
- One of the following alignment styles: Image.TOP
, Image.BOTTOM
,
Image.LEFT
, Image.RIGHT
, Image.VCENTER
, Image.HCENTER
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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.