- arc()
Adds an arc to the path which it center is at (x, y) position with radius r starting at startAngle and ending at endAngle going in the given direction by anticlockwise (defaulting to clockwise).
- arcTo()
Adds an arc with the given control points and radius, connected to the previous point by a straight line.
- beginPath()
Starts a new path by resetting the list of sub-paths. Call this method when you want to create a new path.
- bezierCurveTo()
void bezierCurveTo(
in float cp1x,
in float cp1y,
in float cp2x,
in float cp2y,
in float x,
in float y
);
- clearRect()
Clears the rectangle defined by it starting point at (x, y) and has a w width and a h height.
- clip()
Creates a clipping path from the current sub-paths. Everything drawn after clip() is called appears inside the clipping path only. For an example, see Clipping paths in the Canvas tutorial.
- closePath()
Tries to draw a straight line from the current point to the start. If the shape has already been closed or has only one point, this function does nothing.
- createImageData()
Creates a new, blank ImageData object with the specified dimensions. All of the pixels in the new object are transparent black.
- createLinearGradient()
nsIDOMCanvasGradient createLinearGradient(
in float x0,
in float y0,
in float x1,
in float y1
);
- createPattern()
nsIDOMCanvasPattern createPattern(
in nsIDOMHTMLElement image,
in DOMString repetition
);
- createRadialGradient()
nsIDOMCanvasGradient createRadialGradient(
in float x0,
in float y0,
in float r0,
in float x1,
in float y1,
in float r1
);
- drawCustomFocusRing()
boolean drawCustomFocusRing(Element element);
- drawImage()
Draws the specified image. This method is available in multiple formats, providing a great deal of flexibility in its use.
- drawSystemFocusRing()
void drawSystemFocusRing(Element element);
- fill()
Fills the subpaths with the current fill style.
- fillRect()
Draws a filled rectangle at (x, y) position whose size is determined by width and height.
- fillText()
void fillText(
in DOMString text,
in float x,
in float y,
in float maxWidth [optional]
);
- getImageData()
Returns an ImageData object representing the underlying pixel data for the area of the canvas denoted by the rectangle which starts at (sx, sy) and has a sw width and sh height.
- getLineDash()
Returns an dash list array containing an even number of non-negative numbers.
- isPointInPath()
Reports whether or not the specified point is contained in the current path.
- lineTo()
Connects the last point in the subpath to the x, y coordinates with a straight line.
- measureText()
nsIDOMTextMetrics measureText(
in DOMString text
);
- putImageData()
void putImageData(
in long x,
in long y,
in unsigned long width,
in unsigned long height,
[array, size_is(dataLen)] in octet dataPtr,
in unsigned long dataLen,
in boolean hasDirtyRect,
in long dirtyX, [optional]
in long dirtyY, [optional]
in long dirtyWidth, [optional]
in long dirtyHeight [optional]
);
- quadraticCurveTo()
void quadraticCurveTo(
in float cpx,
in float cpy,
in float x,
in float y
);
- rect()
void rect(
in float x,
in float y,
in float w,
in float h
);
- restore()
Restores the drawing style state to the last element on the 'state stack' saved by save()
- rotate()
void rotate(
in float angle
);
- save()
Saves the current drawing style state using a stack so you can revert any change you make to it using restore().
- scale()
void scale(
in float x,
in float y
);
- scrollPathIntoView()
void scrollPathIntoView();
- setLineDash()
void setLineDash(
sequence segments
);
- setTransform()
void setTransform(
in float m11,
in float m12,
in float m21,
in float m22,
in float dx,
in float dy
);
- stroke()
Strokes the subpaths with the current stroke style.
- strokeRect()
Paints a rectangle which it starting point is at (x, y) and has a w width and a h height onto the canvas, using the current stroke style.
- strokeText()
void strokeText(
in DOMString text,
in float x,
in float y,
in float maxWidth [optional]
);
- transform()
void transform(
in float m11,
in float m12,
in float m21,
in float m22,
in float dx,
in float dy
);
- translate()
Moves the origin point of the context to (x, y).