public interface RenderingBackend
CanvasRenderingContext2D.| Modifier and Type | Method and Description |
|---|---|
void |
arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean anticlockwise)
Adds a circular arc to the current sub-path.
|
void |
beginPath()
Starts a new path by emptying the list of sub-paths.
|
void |
bezierCurveTo(double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
Adds a cubic Bézier curve to the current sub-path.
|
void |
clearRect(int x,
int y,
int w,
int h)
Paints the specified rectangular area.
|
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 |
fill()
Fills the current or given path with the current fillStyle.
|
void |
fillRect(int x,
int y,
int w,
int h)
Paints the specified rectangular area.
|
void |
fillText(String text,
int x,
int y)
Fills a given text at the given (x, y) position.
|
byte[] |
getBytes(int width,
int height,
int sx,
int sy)
Creates a byte array containing the (4) color values of all pixels.
|
int |
getLineWidth()
Returns the
lineWidth property. |
void |
lineTo(double x,
double y)
Adds a straight line to the current sub-path by connecting the
sub-path's last point to the specified (x, y) coordinates.
|
void |
moveTo(double x,
double y)
Begins a new sub-path at the point specified
by the given (x, y) coordinates.
|
void |
quadraticCurveTo(double cpx,
double cpy,
double x,
double y)
Adds a quadratic Bézier curve to the current sub-path.
|
void |
rect(double x,
double y,
double w,
double h)
Adds a rectangle to the current path.
|
void |
restore()
Restores the most recently saved canvas state by popping the top
entry in the drawing state stack.
|
void |
rotate(double angle)
Adds a rotation to the transformation matrix.
|
void |
save()
Saves the entire state of the canvas by pushing
the current state onto a stack.
|
void |
setFillStyle(String fillStyle)
Sets the
fillStyle property. |
void |
setLineWidth(int lineWidth)
Sets the
lineWidth property. |
void |
setStrokeStyle(String strokeStyle)
Sets the
strokeStyle property. |
void |
setTransform(double m11,
double m12,
double m21,
double m22,
double dx,
double dy)
Resets (overrides) the current transformation to the identity matrix,
and then invokes a transformation described by the arguments of this method.
|
void |
stroke()
Strokes (outlines) the current or given path with the current stroke style.
|
void |
strokeRect(int x,
int y,
int w,
int h)
Paints the specified rectangular area.
|
void |
transform(double m11,
double m12,
double m21,
double m22,
double dx,
double dy)
Multiplies the current transformation with the matrix described by the
arguments of this method.
|
void |
translate(int x,
int y)
Adds a translation transformation to the current matrix.
|
void beginPath()
void bezierCurveTo(double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
cp1x - the cp1xcp1y - the cp1ycp2x - the cp2xcp2y - the cp2yx - the xy - the yvoid arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean anticlockwise)
x - the xy - the yradius - the radiusstartAngle - the start angleendAngle - the end angleanticlockwise - is anti-clockwisevoid clearRect(int x,
int y,
int w,
int h)
x - the xy - the yw - the widthh - the heightvoid drawImage(ImageReader imageReader, int dxI, int dyI) throws IOException
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 problemsString encodeToString(String type) throws IOException
type - the name of the image formatIOException - in case o problemsvoid fill()
void fillRect(int x,
int y,
int w,
int h)
x - the xy - the yw - the widthh - the heightvoid fillText(String text, int x, int y)
text - the textx - the xy - the ybyte[] getBytes(int width,
int height,
int sx,
int sy)
width - the widthheight - the heightsx - start point xsy - start point yvoid lineTo(double x,
double y)
x - the xy - the yvoid moveTo(double x,
double y)
x - the xy - the yvoid quadraticCurveTo(double cpx,
double cpy,
double x,
double y)
cpx - the cpxcpy - the cpyx - the xy - the yvoid rect(double x,
double y,
double w,
double h)
x - the xy - the yw - the widthh - the heightvoid restore()
void rotate(double angle)
angle - the anglevoid save()
void setFillStyle(String fillStyle)
fillStyle property.fillStyle - the fillStyle propertyvoid setStrokeStyle(String strokeStyle)
strokeStyle property.strokeStyle - the strokeStyle propertyint getLineWidth()
lineWidth property.lineWidth propertyvoid setLineWidth(int lineWidth)
lineWidth property.lineWidth - the lineWidth propertyvoid setTransform(double m11,
double m12,
double m21,
double m22,
double dx,
double dy)
m11 - Horizontal scaling. A value of 1 results in no scalingm12 - Vertical skewingm21 - Horizontal skewingm22 - Vertical scaling. A value of 1 results in no scalingdx - Horizontal translation (moving)dy - Vertical translation (moving).void stroke()
void strokeRect(int x,
int y,
int w,
int h)
x - the xy - the yw - the widthh - the heightvoid transform(double m11,
double m12,
double m21,
double m22,
double dx,
double dy)
m11 - Horizontal scaling. A value of 1 results in no scalingm12 - Vertical skewingm21 - Horizontal skewingm22 - Vertical scaling. A value of 1 results in no scalingdx - Horizontal translation (moving)dy - Vertical translation (moving).void translate(int x,
int y)
x - the xy - the yCopyright © 2002–2019 Gargoyle Software Inc.. All rights reserved.