|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
Image
public class Image
This class represents loaded image that can be draw
to screen.
Use Style.image(int) or getImage(String) to
obtain image instances.
| Constructor Summary | |
|---|---|
Image(IntArray rgb,
int width,
int height,
boolean processAlpha)
Creates an immutable image from a sequence of ARGB values, specified as 0xAARRGGBB. |
|
Image(int width,
int height)
Creates new Image that can be modified by acquiring the Graphics and drawing into it. |
|
| Method Summary | |
|---|---|
Graphics |
getGraphics()
Returns Graphics object that can be used to draw on this Image. |
Image |
getRegion(int x,
int y,
int w,
int h)
Creates a new image from region of this Image. |
void |
getRGB(IntArray rgbData,
int offset,
int scanlength,
int x,
int y,
int width,
int height)
Obtains ARGB pixel data from the specified region of this image and stores it in the provided array of integers. |
int |
height()
Returns the height of image, in pixels. |
int |
width()
Returns the width of image, in pixels. |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Image(int width,
int height)
width - Width of created imageheight - Height of created imagegetGraphics()
public Image(IntArray rgb,
int width,
int height,
boolean processAlpha)
rgb - an array of ARGB values that composes the imagewidth - the width of the imageheight - the height of the imageprocessAlpha - true if rgb has an alpha channel,
false if all pixels are fully opaque- Since:
- 2.0.0
| Method Detail |
|---|
public int width()
public int height()
public Image getRegion(int x,
int y,
int w,
int h)
x - X-coordinate of top-left cornery - Y-coordinate of top-left cornerw - Width of regionh - Height of region
public Graphics getGraphics()
Image(int, int) constuctor.
public void getRGB(IntArray rgbData,
int offset,
int scanlength,
int x,
int y,
int width,
int height)
0xAARRGGBB format, where
the high-order byte contains the alpha channel and the
remaining bytes contain color components for red,
green and blue, respectively. The alpha channel specifies
the opacity of the pixel, where a value of 0x00 represents
a pixel that is fully transparent and a value of 0xFF
represents a fully opaque pixel.
rgbData - an array of integers in which the ARGB pixel data is storedoffset - the index into the array where the first ARGB value is storedscanlength - the relative offset in the array between corresponding pixels in consecutive rows of the regionx - the x-coordinate of the upper left corner of the regiony - the y-coordinate of the upper left corner of the regionwidth - the width of the regionheight - the height of the region
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||