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 RenderTarget
public void setPixel(int pX, int pY, java.awt.Color pColor)
setPixel
in interface RenderTarget
public int getImageWidth()
getImageWidth
in interface RenderTarget
public int getImageHeight()
getImageHeight
in interface RenderTarget
public void saveToImage(java.io.OutputStream os) throws java.io.IOException
java.io.IOException