public class Image
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Image(int width,
int height,
byte[] data)
Create an image using an already existing byte array.
|
Modifier and Type | Method and Description |
---|---|
static Image |
createImage(Image image,
int x,
int y,
int w,
int h,
int transform)
Creates a new image based upon the transformed region of another image
|
static Image |
createImage(java.io.InputStream s)
Read image from file.
|
static Image |
createImage(int width,
int height)
Create ablank image of the requested size.
|
byte[] |
getData()
Return the byte array used to hold the image data.
|
GraphicsLCD |
getGraphics()
Returns a graphics object that can be used to draw to the image.
|
int |
getHeight()
return the height of the image.
|
int |
getWidth()
Return the width of the image.
|
public Image(int width, int height, byte[] data)
width
- width of the imageheight
- height of the imagedata
- The byte array to be used for image store/public static Image createImage(int width, int height)
width
- height
- public static Image createImage(java.io.InputStream s) throws java.io.IOException
1st byte - 4th byte | 5th byte - 8th byte | 9th byte | 10th byte .... |
---|---|---|---|
image-width (int) | image-height (int) | 0x00 (image data delimit) |
byte image data.... |
For example:
After a file with contentwidth (int) | height (int) | delimit | byte data | ||
---|---|---|---|---|---|
00 00 00 03 | 00 00 00 05 | 00 | 00 | 02 | 1f |
new Image(3, 5, new byte[] {(byte)0x00, (byte)0x02, (byte)0x1f})
s
- The input stream for the image file.java.io.IOException
- if an input or output error occurs or file format is not correct.Image
,
Image(int, int, byte[])
public static Image createImage(Image image, int x, int y, int w, int h, int transform)
image
- Source imagex
- x co-ordinate of the source regiony
- y co-ordinate of the source regionw
- width of the source regionh
- height of the source regiontransform
- Transform to be appliedpublic int getWidth()
public int getHeight()
public byte[] getData()
public GraphicsLCD getGraphics()
GraphicsLCD