|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.nokia.mid.ui.DirectUtils
This class is a placeholder for utility methods. It contains methods for converting standard lcdui classes to Nokia UI classes and vice versa, and a method for creating images that are empty with pixels either transparent or colored, and creating mutable images from encoded image byte arrays.
Graphics
,
DirectGraphics
,
Canvas
,
FullCanvas
Method Summary | |
static javax.microedition.lcdui.Image |
createImage(byte[] imageData,
int imageOffset,
int imageLength)
Creates a mutable image that is decoded from the data stored in the specified byte array at the specified offset and length. |
static javax.microedition.lcdui.Image |
createImage(int width,
int height,
int ARGBcolor)
The method will return a newly created mutable Image with the specified dimension and all the pixels of the image defined by the specified ARGB color. |
static DirectGraphics |
getDirectGraphics(javax.microedition.lcdui.Graphics g)
Converts standard javax.microedition.lcdui.Graphics to DirectGraphics. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static DirectGraphics getDirectGraphics(javax.microedition.lcdui.Graphics g)
Note that even though the graphics context that the DirectGraphics and Graphics refer to is the same, the object reference returned from this method may or may not be equal compared to the Graphics reference passed to this method. This means that purely casting Graphics object (g) passed in paint method of lcdui Canvas to DirectGraphics may not work ok. The safest way is to always do the conversion with this method.
g
- Graphics object for which DirectGraphics should be returned
public static javax.microedition.lcdui.Image createImage(byte[] imageData, int imageOffset, int imageLength)
Note that the semantics of this method are exactly the same
as
Image.createImage(byte[],int,int)
except that the returned image is mutable.
imageData
- the array of image data in a supported image formatimageOffset
- the offset of the start of the data in the arrayimageLength
- the length of the data in the array
java.lang.ArrayIndexOutOfBoundsException
- if imageOffset and
imageLength specify an invalid range
java.lang.NullPointerException
- if imageData is null
java.lang.IllegalArgumentException
- if imageData is incorrectly
formatted or otherwise cannot be decodedImage.createImage(byte[],int,int)
public static javax.microedition.lcdui.Image createImage(int width, int height, int ARGBcolor)
The method will return a newly created mutable Image with the specified dimension and all the pixels of the image defined by the specified ARGB color. The color can contain alpha channel transparency information.
width
- the width of the new image, in pixelsheight
- the height of the new image, in pixelsARGBcolor
- the initial color for image
java.lang.IllegalArgumentException
- if either width or height is
zero or less
|
forum.nokia.com/java | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |