Skip to content

CanvasRenderingContext2D

Values

arc

let arc: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~radius: float,
~startAngle: float,
~endAngle: float,
~counterclockwise: bool=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float option< bool >

Return type

unit

arcTo

let arcTo: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x1: float,
~y1: float,
~x2: float,
~y2: float,
~radius: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float

Return type

unit

beginPath

let beginPath: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

bezierCurveTo

let bezierCurveTo: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~cp1x: float,
~cp1y: float,
~cp2x: float,
~cp2y: float,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float float

Return type

unit

clearRect

let clearRect: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

unit

clip

let clip: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => unit

clip2

let clip2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~path: WebAPI.CanvasAPI.path2D,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => unit

closePath

let closePath: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

createConicGradient

let createConicGradient: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~startAngle: float,
~x: float,
~y: float,
) => WebAPI.CanvasAPI.canvasGradient

createImageData

let createImageData: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~sw: int,
~sh: int,
~settings: WebAPI.DOMAPI.imageDataSettings=?,
) => WebAPI.DOMAPI.imageData

createImageData2

let createImageData2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
WebAPI.DOMAPI.imageData,
) => WebAPI.DOMAPI.imageData

createLinearGradient

let createLinearGradient: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x0: float,
~y0: float,
~x1: float,
~y1: float,
) => WebAPI.CanvasAPI.canvasGradient

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

WebAPI.CanvasAPI.canvasGradient

createPattern

let createPattern: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlImageElement,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern2

let createPattern2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.svgImageElement,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern3

let createPattern3: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlVideoElement,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern4

let createPattern4: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlCanvasElement,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern5

let createPattern5: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.imageBitmap,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern6

let createPattern6: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.offscreenCanvas,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createPattern7

let createPattern7: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.videoFrame,
~repetition: string,
) => WebAPI.CanvasAPI.canvasPattern

createRadialGradient

let createRadialGradient: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x0: float,
~y0: float,
~r0: float,
~x1: float,
~y1: float,
~r1: float,
) => WebAPI.CanvasAPI.canvasGradient

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float float

Return type

WebAPI.CanvasAPI.canvasGradient

drawFocusIfNeeded

let drawFocusIfNeeded: (
WebAPI.DOMAPI.canvasRenderingContext2D,
WebAPI.DOMAPI.element,
) => unit

drawFocusIfNeeded2

let drawFocusIfNeeded2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~path: WebAPI.CanvasAPI.path2D,
~element: WebAPI.DOMAPI.element,
) => unit

drawImage

let drawImage: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlImageElement,
~dx: float,
~dy: float,
) => unit

drawImage10

let drawImage10: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlVideoElement,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlVideoElement float float float float

Return type

unit

drawImage11

let drawImage11: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlCanvasElement,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlCanvasElement float float float float

Return type

unit

drawImage12

let drawImage12: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.imageBitmap,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.CanvasAPI.imageBitmap float float float float

Return type

unit

drawImage13

let drawImage13: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.offscreenCanvas,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.CanvasAPI.offscreenCanvas float float float float

Return type

unit

drawImage14

let drawImage14: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.videoFrame,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.videoFrame float float float float

Return type

unit

drawImage15

let drawImage15: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlImageElement,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlImageElement float float float float float float float float

Return type

unit

drawImage16

let drawImage16: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.svgImageElement,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.svgImageElement float float float float float float float float

Return type

unit

drawImage17

let drawImage17: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlVideoElement,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlVideoElement float float float float float float float float

Return type

unit

drawImage18

let drawImage18: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlCanvasElement,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlCanvasElement float float float float float float float float

Return type

unit

drawImage19

let drawImage19: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.imageBitmap,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.CanvasAPI.imageBitmap float float float float float float float float

Return type

unit

drawImage2

let drawImage2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.svgImageElement,
~dx: float,
~dy: float,
) => unit

drawImage20

let drawImage20: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.offscreenCanvas,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.CanvasAPI.offscreenCanvas float float float float float float float float

Return type

unit

drawImage21

let drawImage21: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.videoFrame,
~sx: float,
~sy: float,
~sw: float,
~sh: float,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.videoFrame float float float float float float float float

Return type

unit

drawImage3

let drawImage3: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlVideoElement,
~dx: float,
~dy: float,
) => unit

drawImage4

let drawImage4: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlCanvasElement,
~dx: float,
~dy: float,
) => unit

drawImage5

let drawImage5: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.imageBitmap,
~dx: float,
~dy: float,
) => unit

drawImage6

let drawImage6: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.CanvasAPI.offscreenCanvas,
~dx: float,
~dy: float,
) => unit

drawImage7

let drawImage7: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.videoFrame,
~dx: float,
~dy: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.videoFrame float float

Return type

unit

drawImage8

let drawImage8: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.htmlImageElement,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.htmlImageElement float float float float

Return type

unit

drawImage9

let drawImage9: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~image: WebAPI.DOMAPI.svgImageElement,
~dx: float,
~dy: float,
~dw: float,
~dh: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.svgImageElement float float float float

Return type

unit

ellipse

let ellipse: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~radiusX: float,
~radiusY: float,
~rotation: float,
~startAngle: float,
~endAngle: float,
~counterclockwise: bool=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float float float option< bool >

Return type

unit

fill

let fill: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => unit

fill2

let fill2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~path: WebAPI.CanvasAPI.path2D,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => unit

fillRect

let fillRect: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

unit

fillText

let fillText: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~text: string,
~x: float,
~y: float,
~maxWidth: float=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D string float float option< float >

Return type

unit

getContextAttributes

let getContextAttributes: WebAPI.DOMAPI.canvasRenderingContext2D => WebAPI.CanvasAPI.canvasRenderingContext2DSettings

getImageData

let getImageData: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~sx: int,
~sy: int,
~sw: int,
~sh: int,
~settings: WebAPI.DOMAPI.imageDataSettings=?,
) => WebAPI.DOMAPI.imageData

getLineDash

let getLineDash: WebAPI.DOMAPI.canvasRenderingContext2D => array<float>

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

array< float >

getTransform

let getTransform: WebAPI.DOMAPI.canvasRenderingContext2D => WebAPI.DOMAPI.domMatrix

isContextLost

let isContextLost: WebAPI.DOMAPI.canvasRenderingContext2D => bool

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

bool

isPointInPath

let isPointInPath: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => bool

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float option< WebAPI.CanvasAPI.canvasFillRule >

Return type

bool

isPointInPath2

let isPointInPath2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~path: WebAPI.CanvasAPI.path2D,
~x: float,
~y: float,
~fillRule: WebAPI.CanvasAPI.canvasFillRule=?,
) => bool

isPointInStroke

let isPointInStroke: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
) => bool

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float

Return type

bool

isPointInStroke2

let isPointInStroke2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~path: WebAPI.CanvasAPI.path2D,
~x: float,
~y: float,
) => bool

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.CanvasAPI.path2D float float

Return type

bool

lineTo

let lineTo: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float

Return type

unit

measureText

let measureText: (
WebAPI.DOMAPI.canvasRenderingContext2D,
string,
) => WebAPI.CanvasAPI.textMetrics

moveTo

let moveTo: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float

Return type

unit

putImageData

let putImageData: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~imagedata: WebAPI.DOMAPI.imageData,
~dx: int,
~dy: int,
) => unit

putImageData2

let putImageData2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~imagedata: WebAPI.DOMAPI.imageData,
~dx: int,
~dy: int,
~dirtyX: int,
~dirtyY: int,
~dirtyWidth: int,
~dirtyHeight: int,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D WebAPI.DOMAPI.imageData int int int int int int

Return type

unit

quadraticCurveTo

let quadraticCurveTo: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~cpx: float,
~cpy: float,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

unit

rect

let rect: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

unit

reset

let reset: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

resetTransform

let resetTransform: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

restore

let restore: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

rotate

let rotate: (WebAPI.DOMAPI.canvasRenderingContext2D, float) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float

Return type

unit

roundRect

let roundRect: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float option< array< float > >

Return type

unit

roundRect2

let roundRect2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float option< array< float > >

Return type

unit

roundRect3

let roundRect3: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
~radii_: array<float>=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float option< array< float > >

Return type

unit

save

let save: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

scale

let scale: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float

Return type

unit

setLineDash

let setLineDash: (
WebAPI.DOMAPI.canvasRenderingContext2D,
array<float>,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D array< float >

Return type

unit

setTransform

let setTransform: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~a: float,
~b: float,
~c: float,
~d: float,
~e: float,
~f: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float float

Return type

unit

setTransform2

let setTransform2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~transform: WebAPI.DOMAPI.domMatrix2DInit=?,
) => unit

stroke

let stroke: WebAPI.DOMAPI.canvasRenderingContext2D => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D

Return type

unit

stroke2

let stroke2: (
WebAPI.DOMAPI.canvasRenderingContext2D,
WebAPI.CanvasAPI.path2D,
) => unit

strokeRect

let strokeRect: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
~w: float,
~h: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float

Return type

unit

strokeText

let strokeText: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~text: string,
~x: float,
~y: float,
~maxWidth: float=?,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D string float float option< float >

Return type

unit

transform

let transform: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~a: float,
~b: float,
~c: float,
~d: float,
~e: float,
~f: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float float float float float

Return type

unit

translate

let translate: (
WebAPI.DOMAPI.canvasRenderingContext2D,
~x: float,
~y: float,
) => unit

Parameters

WebAPI.DOMAPI.canvasRenderingContext2D float float

Return type

unit