public class PixelCanvas extends Object implements RenderTarget
Swing compatible drawing surface for images and graphics.
© 2002 Christian Treber, [email protected]
Constructor and Description |
---|
PixelCanvas(int pWidth,
int pHeight)
Construct a canvas of the specified size.
|
Modifier and Type | Method and Description |
---|---|
Graphics2D |
getGraphics2D() |
int |
getImageHeight() |
int |
getImageWidth() |
void |
saveToImage(OutputStream os) |
boolean |
saveToImage(String pFileName,
String pFormat) |
void |
setPixel(int pX,
int pY,
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 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, Color pColor)
setPixel
in interface RenderTarget
public int getImageWidth()
getImageWidth
in interface RenderTarget
public int getImageHeight()
getImageHeight
in interface RenderTarget
public boolean saveToImage(String pFileName, String pFormat) throws IOException
IOException
public void saveToImage(OutputStream os) throws IOException
IOException
Copyright © 2016. All Rights Reserved.