Example usage for Java com.google.gwt.canvas.dom.client Context2d fields, constructors, methods, implement or subclass
The text is from its open source code.
void | arc(double x, double y, double radius, double startAngle, double endAngle, boolean anticlockwise) Draws an arc. |
void | arc(double x, double y, double radius, double startAngle, double endAngle) Draws an arc. |
void | arcTo(double x1, double y1, double x2, double y2, double radius) Adds an arc to the current subpath, connecting it to the current point with a line segment. |
void | beginPath() Begins a new path. |
void | bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y) Draws a cubic B\u00e9zier curve from the current point to the point (x, y), with control points (cp1x, cp1y) and (cp2x, cp2y). |
void | clearRect(double x, double y, double w, double h) Clears a rectangle. |
void | clip() Creates a new clipping region from the current path. |
void | closePath() Closes the current path. |
ImageData | createImageData(int w, int h) Creates an image data object of the given size. |
CanvasGradient | createLinearGradient(double x0, double y0, double x1, double y1) Creates a linear gradient. |
CanvasPattern | createPattern(CanvasElement image, Repetition repetition) Creates a pattern from another canvas. |
CanvasPattern | createPattern(CanvasElement image, String repetition) Creates a pattern from another canvas. |
CanvasPattern | createPattern(ImageElement image, Repetition repetition) Creates a pattern from an image. |
CanvasPattern | createPattern(ImageElement image, String repetition) Creates a pattern from an image. |
void | drawImage(CanvasElement image, double dx, double dy) Draws an image. |
void | drawImage(ImageElement image, double dx, double dy) Draws an image. |
void | drawImage(CanvasElement image, double dx, double dy, double dw, double dh) Draws a scaled image. |
void | drawImage(ImageElement image, double dx, double dy, double dw, double dh) Draws a scaled image. |
void | drawImage(CanvasElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh) Draws a scaled subset of an image. |
void | drawImage(ImageElement image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh) Draws a scaled subset of an image. |
void | fill() Fills the current path. |
void | fillRect(double x, double y, double w, double h) Fills a rectangle. |
void | fillText(String text, double x, double y) Draws filled text. |
void | fillText(String text, double x, double y, double maxWidth) Draws filled text squeezed into the given max width. |
CanvasElement | getCanvas() Gets this context's canvas. |
FillStrokeStyle | getFillStyle() Returns the context's fillStyle. |
ImageData | getImageData(double sx, double sy, double sw, double sh) Returns an image data object for the screen area denoted by sx, sy, sw and sh. |
double | getLineWidth() Gets the current line-width. |
FillStrokeStyle | getStrokeStyle() Returns the context's strokeStyle. |
void | lineTo(double x, double y) Adds a line from the current point to the point (x, y) to the current path. |
TextMetrics | measureText(String text) Returns the metrics for the given text. |
void | moveTo(double x, double y) Terminates the current path and sets the current path position to the point (x, y). |
void | putImageData(ImageData imagedata, double x, double y) Draws the given image data at the given screen position. |
void | quadraticCurveTo(double cpx, double cpy, double x, double y) Draws a quadratic B\u00e9zier curve from the current point to the point (x, y), with control point (cpx, cpy). |
void | rect(double x, double y, double w, double h) Creates a new rectangular path. |
void | restore() Restores the context's state. |
void | rotate(double angle) Applies rotation to the current transform. |
void | save() Saves the context's state. |
void | scale(double x, double y) Applies scale to the current transform. |
void | setFillStyle(FillStrokeStyle fillStyle) Sets the context's fillStyle. |
void | setFillStyle(String fillStyleColor) Convenience method to set the context's fillStyle to a CssColor , specified in String form. |
void | setFont(String f) Sets the font. |
void | setGlobalAlpha(double alpha) Sets the global alpha value. |
void | setGlobalCompositeOperation(Composite composite) Sets the global composite operation. |
void | setGlobalCompositeOperation(String globalCompositeOperation) Sets the global composite operation. |
void | setLineCap(LineCap lineCap) Sets the line-cap style. |
void | setLineCap(String lineCap) Sets the line-cap style. |
void | setLineJoin(LineJoin lineJoin) Sets the line-join style. |
void | setLineJoin(String lineJoin) Sets the line-join style. |
void | setLineWidth(double lineWidth) Sets the line-width. |
void | setMiterLimit(double miterLimit) Sets the miter-limit. |
void | setShadowBlur(double shadowBlur) Sets the shadow-blur. |
void | setShadowColor(String shadowColor) Sets the shadow-color. |
void | setShadowOffsetY(double shadowOffsetY) Sets the y-shadow-offset. |
void | setStrokeStyle(FillStrokeStyle strokeStyle) Sets the context's stroke style. |
void | setStrokeStyle(String strokeStyleColor) Convenience method to set the context's strokeStyle to a CssColor . |
void | setTextAlign(String align) Sets the text alignment. |
void | setTextAlign(TextAlign align) Sets the text alignment. |
void | setTextBaseline(String baseline) Sets the text baseline. |
void | setTextBaseline(TextBaseline baseline) Sets the text baseline. |
void | stroke() Draws the current path with the current stroke style. |
void | strokeRect(double x, double y, double w, double h) Draws the outline of a rectangle with the current stroke style. |
void | strokeText(String text, double x, double y) Draws the text outline. |
void | transform(double m11, double m12, double m21, double m22, double dx, double dy) Multiplies the current transform by the given matrix. |
void | translate(double x, double y) Applies a translation to the current transform. |