public class PixelCanvas extends java.lang.Object implements RenderTarget
Swing compatible drawing surface for images and graphics.
© 2002 Christian Treber, ct@ctreber.com
| Constructor and Description |
|---|
PixelCanvas(int pWidth,
int pHeight)
Construct a canvas of the specified size.
|
| Modifier and Type | Method and Description |
|---|---|
java.awt.Graphics2D |
getGraphics2D() |
int |
getImageHeight() |
int |
getImageWidth() |
void |
saveToImage(java.io.OutputStream os) |
void |
setPixel(int pX,
int pY,
java.awt.Color pColor) |
void |
setPixel(int pX,
int pY,
int pA,
int pR,
int pG,
int pB) |
public PixelCanvas(int pWidth,
int pHeight)
Construct a canvas of the specified size.
pWidth - WidthpHeight - Heightpublic java.awt.Graphics2D getGraphics2D()
public void setPixel(int pX,
int pY,
int pA,
int pR,
int pG,
int pB)
setPixel in interface RenderTargetpublic void setPixel(int pX,
int pY,
java.awt.Color pColor)
setPixel in interface RenderTargetpublic int getImageWidth()
getImageWidth in interface RenderTargetpublic int getImageHeight()
getImageHeight in interface RenderTargetpublic void saveToImage(java.io.OutputStream os)
throws java.io.IOException
java.io.IOException