|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jcontrol.graphics.BufferedImage
public class BufferedImage
The
BufferedImage
is an image that can be allocated and modified at runtime. To draw
on the BufferedImage
, a BufferGraphics
object can be obtained via the
getGraphics()
method. A BufferedImage
can be drawn to the display by
using the display's drawImage()
methods.
The size of the buffer required to store the pixel values is width*height*2 bytes.
Example:
// this example draws a circle into a BufferedImage
//and shows it on the display.
BufferedImage image = new BufferedImage( 64, 64);
XGraphics imageGraphics = image.getGraphics();
imageGraphics.setForeground( 0xFFFF0000);
imageGraphics.drawOval( 0, 0, 64, 64);
Display d = new Display();
d.drawImage( image, 24, 24);
BufferGraphics
,
Display
Constructor Summary | |
---|---|
BufferedImage(int width,
int height)
Creates a new BufferedImage of the given size. |
Method Summary | |
---|---|
void |
draw(Graphics graphics,
int x,
int y)
Draws the BufferedImage to the specified coordinates. |
void |
draw(Graphics graphics,
int x,
int y,
int width,
int height,
int xoff,
int yoff)
Draws a subimage of the BufferedImage to the specified coordinates. |
void |
draw(XGraphics graphics,
int x,
int y,
int anchor)
NOTE: not supported Draws the BufferedImage to the specified coordinates with an anchor. |
protected void |
finalize()
free internal data structures used by this bufferedimage object. |
XGraphics |
getGraphics()
Returns an XGraphics object that can be used to draw on the BufferedImage. |
int |
getHeight()
Returns the BufferedImage height. |
int |
getWidth()
Returns the BufferedImage width. |
boolean |
isValid()
Checks if the Image is properly configured and ready for use. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, notifyAll, toString, wait |
Constructor Detail |
---|
public BufferedImage(int width, int height)
width
- image widthheight
- image heightMethod Detail |
---|
public XGraphics getGraphics()
BufferGraphics
object)public int getHeight()
getHeight
in interface Image
public int getWidth()
getWidth
in interface Image
public boolean isValid()
isValid
in interface Image
public void draw(Graphics graphics, int x, int y)
draw
in interface Drawable
graphics
- Graphics object to use for drawingx
- the horizontal coordinatey
- the vertical coordinatepublic void draw(Graphics graphics, int x, int y, int width, int height, int xoff, int yoff)
draw
in interface Drawable
graphics
- Graphics object to use for drawingx
- the horizontal coordinatey
- the vertical coordinatewidth
- the width of the sub image within the source imageheight
- the height of the sub image within the source imagexoff
- horizontal offset of the sub image within the source imageyoff
- vertical offset of the sub image within the source imagedraw(Graphics, int, int)
public void draw(XGraphics graphics, int x, int y, int anchor)
draw
in interface Image
x
- the horizontal coordinatey
- the vertical coordinateanchor
- anchorgraphics
- XGraphics to draw onXGraphics
protected void finalize()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |