public class AwtRenderingBackend extends Object implements RenderingBackend
CanvasRenderingContext2D
.Constructor and Description |
---|
AwtRenderingBackend(int imageWidth,
int imageHeight)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
drawImage(ImageReader imageReader,
int dxI,
int dyI)
Draws images onto the context.
|
String |
encodeToString(String type)
Constructs a base64 encoded string out of the image data.
|
void |
fillRect(int x,
int y,
int w,
int h)
Paints the specified rectangular area.
|
byte[] |
getBytes(int width,
int height,
int sx,
int sy)
Creates a byte array containing the (4) color values of all pixels.
|
void |
setFillStyle(String fillStyle)
Sets the
fillStyle property. |
public AwtRenderingBackend(int imageWidth, int imageHeight)
imageWidth
- the widthimageHeight
- the heightpublic void setFillStyle(String fillStyle)
fillStyle
property.setFillStyle
in interface RenderingBackend
fillStyle
- the fillStyle
propertypublic void fillRect(int x, int y, int w, int h)
fillRect
in interface RenderingBackend
x
- the xy
- the yw
- the widthh
- the heightpublic void drawImage(ImageReader imageReader, int dxI, int dyI) throws IOException
drawImage
in interface RenderingBackend
imageReader
- the reader to read the image from 8the first one)dxI
- the x coordinate of the starting point (top left)dyI
- the y coordinate of the starting point (top left)IOException
- in case o problemspublic byte[] getBytes(int width, int height, int sx, int sy)
getBytes
in interface RenderingBackend
width
- the widthheight
- the heightsx
- start point xsy
- start point ypublic String encodeToString(String type) throws IOException
encodeToString
in interface RenderingBackend
type
- the name of the image formatIOException
- in case o problemsCopyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.