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:

Variables

Methods

addHitRegion (?options:HitRegionOptions):Void

Throws:

null

DOMError

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

clip (path:Path2D, winding:CanvasWindingRule = "nonzero"):Void

clip (winding:CanvasWindingRule = "nonzero"):Void

createImageData (imagedata:ImageData):ImageData

createImageData (sw:Float, sh:Float):ImageData

Throws:

null

DOMError

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

Throws:

null

DOMError

drawFocusIfNeeded (element:Element):Void

Throws:

null

DOMError

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

Throws:

null

DOMError

fill (path:Path2D, winding:CanvasWindingRule = "nonzero"):Void

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

isPointInPath (path:Path2D, x:Float, y:Float, winding:CanvasWindingRule = "nonzero"):Bool

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