To get an object of this interface, call getContext() on a canvas element, supplying "2d" as the argument:

Documentation CanvasRenderingContext2D by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See also:

Variables

Methods

addHitRegion(?options:Null<HitRegionOptions>):Void

Throws:

null

DOMError

@:value({ anticlockwise : false })arc(x:Float, y:Float, radius:Float, startAngle:Float, endAngle:Float, anticlockwise:Bool = false):Void

Throws:

null

DOMError

arcTo(x1:Float, y1:Float, x2:Float, y2:Float, radius:Float):Void

Throws:

null

DOMError

bezierCurveTo(cp1x:Float, cp1y:Float, cp2x:Float, cp2y:Float, x:Float, y:Float):Void

@:value({ winding : NONZERO })clip(path:Path2D, winding:CanvasWindingRule = NONZERO):Void

@:value({ winding : NONZERO })clip(winding:CanvasWindingRule = NONZERO):Void

createRadialGradient(x0:Float, y0:Float, r0:Float, x1:Float, y1:Float, r1:Float):CanvasGradient

Throws:

null

DOMError

drawFocusIfNeeded(element:Element):Void

Throws:

null

DOMError

drawImage(image:ImageElement, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:ImageElement, dx:Float, dy:Float):Void

drawImage(image:CanvasElement, dx:Float, dy:Float):Void

drawImage(image:VideoElement, dx:Float, dy:Float):Void

drawImage(image:ImageBitmap, dx:Float, dy:Float):Void

drawImage(image:ImageElement, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:CanvasElement, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:VideoElement, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:ImageBitmap, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:ImageElement, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:CanvasElement, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:VideoElement, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:ImageBitmap, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void

drawImage(image:ImageElement, dx:Float, dy:Float):Void

drawImage(image:ImageElement, dx:Float, dy:Float, dw:Float, dh:Float):Void

Throws:

null

DOMError

@:value({ anticlockwise : false })ellipse(x:Float, y:Float, radiusX:Float, radiusY:Float, rotation:Float, startAngle:Float, endAngle:Float, anticlockwise:Bool = false):Void

Throws:

null

DOMError

@:value({ winding : NONZERO })fill(path:Path2D, winding:CanvasWindingRule = NONZERO):Void

@:value({ winding : NONZERO })fill(winding:CanvasWindingRule = NONZERO):Void

fillText(text:String, x:Float, y:Float, ?maxWidth:Float):Void

Throws:

null

DOMError

getImageData(sx:Float, sy:Float, sw:Float, sh:Float):ImageData

Throws:

null

DOMError

@:value({ winding : NONZERO })isPointInPath(path:Path2D, x:Float, y:Float, winding:CanvasWindingRule = NONZERO):Bool

@:value({ winding : NONZERO })isPointInPath(x:Float, y:Float, winding:CanvasWindingRule = NONZERO):Bool

measureText(text:String):TextMetrics

Throws:

null

DOMError

putImageData(imagedata:ImageData, dx:Float, dy:Float, dirtyX:Float, dirtyY:Float, dirtyWidth:Float, dirtyHeight:Float):Void

putImageData(imagedata:ImageData, dx:Float, dy:Float):Void

Throws:

null

DOMError

resetTransform():Void

Throws:

null

DOMError

rotate(angle:Float):Void

Throws:

null

DOMError

scale(x:Float, y:Float):Void

Throws:

null

DOMError

setLineDash(segments:Array<Float>):Void

Throws:

null

DOMError

setTransform(a:Float, b:Float, c:Float, d:Float, e:Float, f:Float):Void

Throws:

null

DOMError

strokeText(text:String, x:Float, y:Float, ?maxWidth:Float):Void

Throws:

null

DOMError

transform(a:Float, b:Float, c:Float, d:Float, e:Float, f:Float):Void

Throws:

null

DOMError

translate(x:Float, y:Float):Void

Throws:

null

DOMError