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
arc (x:Float, y:Float, radius:Float, startAngle:Float, endAngle:Float, anticlockwise:Bool = false):Void
Throws:
null | DOMError |
---|
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 |
---|
createPattern (image:EitherType<ImageElement, EitherType<CanvasElement, EitherType<VideoElement, ImageBitmap>>>, repetition:String):CanvasPattern
Throws:
null | DOMError |
---|
createRadialGradient (x0:Float, y0:Float, r0:Float, x1:Float, y1:Float, r1:Float):CanvasGradient
Throws:
null | DOMError |
---|
drawImage (image:EitherType<ImageElement, EitherType<CanvasElement, EitherType<VideoElement, ImageBitmap>>>, sx:Float, sy:Float, sw:Float, sh:Float, dx:Float, dy:Float, dw:Float, dh:Float):Void
drawImage (image:EitherType<ImageElement, EitherType<CanvasElement, EitherType<VideoElement, ImageBitmap>>>, dx:Float, dy:Float):Void
drawImage (image:EitherType<ImageElement, EitherType<CanvasElement, EitherType<VideoElement, ImageBitmap>>>, dx:Float, dy:Float, dw:Float, dh:Float):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
isPointInPath (path:Path2D, x:Float, y:Float, winding:CanvasWindingRule = "nonzero"):Bool
isPointInPath (x:Float, y:Float, winding:CanvasWindingRule = "nonzero"):Bool