com.ctreber.acearth.gui
Class PixelCanvas
java.lang.Object
com.ctreber.acearth.gui.PixelCanvas
- All Implemented Interfaces:
- RenderTarget
- Direct Known Subclasses:
- CanvasACearth
public class PixelCanvas
- extends Object
- implements RenderTarget
Swing compatible drawing surface for images and graphics.
© 2002 Christian Treber, [email protected]
- Author:
- Christian Treber, [email protected]
Constructor Summary |
PixelCanvas(int pWidth,
int pHeight)
Construct a canvas of the specified size. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PixelCanvas
public PixelCanvas(int pWidth,
int pHeight)
Construct a canvas of the specified size.
- Parameters:
pWidth
- WidthpHeight
- Height
getGraphics2D
public Graphics2D getGraphics2D()
setPixel
public void setPixel(int pX,
int pY,
int pA,
int pR,
int pG,
int pB)
- Specified by:
setPixel
in interface RenderTarget
setPixel
public void setPixel(int pX,
int pY,
Color pColor)
- Specified by:
setPixel
in interface RenderTarget
getImageWidth
public int getImageWidth()
- Specified by:
getImageWidth
in interface RenderTarget
getImageHeight
public int getImageHeight()
- Specified by:
getImageHeight
in interface RenderTarget
saveToImage
public boolean saveToImage(String pFileName,
String pFormat)
throws IOException
- Throws:
IOException
saveToImage
public void saveToImage(OutputStream os)
throws IOException
- Throws:
IOException
Copyright © 2013. All Rights Reserved.