CanvasRenderingContext2D
Types
t
type t = WebAPI.DOM.canvasRenderingContext2DValues
arc
let arc: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~radius: float, ~startAngle: float, ~endAngle: float, ~counterclockwise: bool=?,) => unitParameters
~x: float
~y: float
~radius: float
~startAngle: float
~endAngle: float
~counterclockwise: bool=?
Return type
unitarcTo
let arcTo: ( WebAPI.DOM.canvasRenderingContext2D, ~x1: float, ~y1: float, ~x2: float, ~y2: float, ~radius: float,) => unitParameters
~x1: float
~y1: float
~x2: float
~y2: float
~radius: float
Return type
unitbeginPath
let beginPath: WebAPI.DOM.canvasRenderingContext2D => unitbezierCurveTo
let bezierCurveTo: ( WebAPI.DOM.canvasRenderingContext2D, ~cp1x: float, ~cp1y: float, ~cp2x: float, ~cp2y: float, ~x: float, ~y: float,) => unitParameters
~cp1x: float
~cp1y: float
~cp2x: float
~cp2y: float
~x: float
~y: float
Return type
unitclearRect
let clearRect: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float,) => unitclip
let clip: ( WebAPI.DOM.canvasRenderingContext2D, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => unitParameters
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
unitclip2
let clip2: ( WebAPI.DOM.canvasRenderingContext2D, ~path: WebAPI.CanvasTypes.path2D, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => unitParameters
~path: WebAPI.CanvasTypes.path2D
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
unitclosePath
let closePath: WebAPI.DOM.canvasRenderingContext2D => unitcreateConicGradient
let createConicGradient: ( WebAPI.DOM.canvasRenderingContext2D, ~startAngle: float, ~x: float, ~y: float,) => WebAPI.CanvasTypes.canvasGradientcreateImageData
let createImageData: ( WebAPI.DOM.canvasRenderingContext2D, ~sw: int, ~sh: int, ~settings: WebAPI.DOM.imageDataSettings=?,) => WebAPI.DOM.imageDatacreateImageData2
let createImageData2: ( WebAPI.DOM.canvasRenderingContext2D, WebAPI.DOM.imageData,) => WebAPI.DOM.imageDatacreateLinearGradient
let createLinearGradient: ( WebAPI.DOM.canvasRenderingContext2D, ~x0: float, ~y0: float, ~x1: float, ~y1: float,) => WebAPI.CanvasTypes.canvasGradientcreatePattern
let createPattern: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLImageElement.t, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.HTMLImageElement.t
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern2
let createPattern2: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.SVGElement.svgImageElement, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern3
let createPattern3: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLVideoElement.t, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.HTMLVideoElement.t
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern4
let createPattern4: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLCanvasElement.t, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.HTMLCanvasElement.t
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern5
let createPattern5: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.imageBitmap, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.CanvasTypes.imageBitmap
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern6
let createPattern6: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.offscreenCanvas, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.CanvasTypes.offscreenCanvas
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createPattern7
let createPattern7: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.DOM.videoFrame, ~repetition: string,) => Null.t<WebAPI.CanvasTypes.canvasPattern>Parameters
~image: WebAPI.DOM.videoFrame
~repetition: string
Return type
Null.t<WebAPI.CanvasTypes.canvasPattern>createRadialGradient
let createRadialGradient: ( WebAPI.DOM.canvasRenderingContext2D, ~x0: float, ~y0: float, ~r0: float, ~x1: float, ~y1: float, ~r1: float,) => WebAPI.CanvasTypes.canvasGradientParameters
~x0: float
~y0: float
~r0: float
~x1: float
~y1: float
~r1: float
Return type
WebAPI.CanvasTypes.canvasGradientdrawFocusIfNeeded
let drawFocusIfNeeded: ( WebAPI.DOM.canvasRenderingContext2D, WebAPI.DOMTree.element,) => unitdrawFocusIfNeeded2
let drawFocusIfNeeded2: ( WebAPI.DOM.canvasRenderingContext2D, ~path: WebAPI.CanvasTypes.path2D, ~element: WebAPI.DOMTree.element,) => unitdrawImage
let drawImage: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLImageElement.t, ~dx: float, ~dy: float,) => unitdrawImageWithCanvas
let drawImageWithCanvas: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLCanvasElement.t, ~dx: float, ~dy: float,) => unitdrawImageWithCanvasDimensions
let drawImageWithCanvasDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLCanvasElement.t, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitdrawImageWithCanvasSubRectangle
let drawImageWithCanvasSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLCanvasElement.t, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.HTMLCanvasElement.t
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithDimensions
let drawImageWithDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLImageElement.t, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitdrawImageWithImageBitmap
let drawImageWithImageBitmap: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.imageBitmap, ~dx: float, ~dy: float,) => unitdrawImageWithImageBitmapDimensions
let drawImageWithImageBitmapDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.imageBitmap, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.CanvasTypes.imageBitmap
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithImageBitmapSubRectangle
let drawImageWithImageBitmapSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.imageBitmap, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.CanvasTypes.imageBitmap
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithOffscreenCanvas
let drawImageWithOffscreenCanvas: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.offscreenCanvas, ~dx: float, ~dy: float,) => unitParameters
~image: WebAPI.CanvasTypes.offscreenCanvas
~dx: float
~dy: float
Return type
unitdrawImageWithOffscreenCanvasDimensions
let drawImageWithOffscreenCanvasDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.offscreenCanvas, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.CanvasTypes.offscreenCanvas
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithOffscreenCanvasSubRectangle
let drawImageWithOffscreenCanvasSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.CanvasTypes.offscreenCanvas, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.CanvasTypes.offscreenCanvas
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithSubRectangle
let drawImageWithSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLImageElement.t, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.HTMLImageElement.t
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithSvg
let drawImageWithSvg: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.SVGElement.svgImageElement, ~dx: float, ~dy: float,) => unitParameters
~dx: float
~dy: float
Return type
unitdrawImageWithSvgDimensions
let drawImageWithSvgDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.SVGElement.svgImageElement, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithSvgSubRectangle
let drawImageWithSvgSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.SVGElement.svgImageElement, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithVideo
let drawImageWithVideo: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLVideoElement.t, ~dx: float, ~dy: float,) => unitdrawImageWithVideoDimensions
let drawImageWithVideoDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLVideoElement.t, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitdrawImageWithVideoFrame
let drawImageWithVideoFrame: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.DOM.videoFrame, ~dx: float, ~dy: float,) => unitdrawImageWithVideoFrameDimensions
let drawImageWithVideoFrameDimensions: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.DOM.videoFrame, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitdrawImageWithVideoFrameSubRectangle
let drawImageWithVideoFrameSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.DOM.videoFrame, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.DOM.videoFrame
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitdrawImageWithVideoSubRectangle
let drawImageWithVideoSubRectangle: ( WebAPI.DOM.canvasRenderingContext2D, ~image: WebAPI.HTMLVideoElement.t, ~sx: float, ~sy: float, ~sw: float, ~sh: float, ~dx: float, ~dy: float, ~dw: float, ~dh: float,) => unitParameters
~image: WebAPI.HTMLVideoElement.t
~sx: float
~sy: float
~sw: float
~sh: float
~dx: float
~dy: float
~dw: float
~dh: float
Return type
unitellipse
let ellipse: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~radiusX: float, ~radiusY: float, ~rotation: float, ~startAngle: float, ~endAngle: float, ~counterclockwise: bool=?,) => unitParameters
~x: float
~y: float
~radiusX: float
~radiusY: float
~rotation: float
~startAngle: float
~endAngle: float
~counterclockwise: bool=?
Return type
unitfill
let fill: ( WebAPI.DOM.canvasRenderingContext2D, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => unitParameters
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
unitfill2
let fill2: ( WebAPI.DOM.canvasRenderingContext2D, ~path: WebAPI.CanvasTypes.path2D, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => unitParameters
~path: WebAPI.CanvasTypes.path2D
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
unitfillRect
let fillRect: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float,) => unitfillText
let fillText: ( WebAPI.DOM.canvasRenderingContext2D, ~text: string, ~x: float, ~y: float, ~maxWidth: float=?,) => unitParameters
~text: string
~x: float
~y: float
~maxWidth: float=?
Return type
unitgetContextAttributes
let getContextAttributes: WebAPI.DOM.canvasRenderingContext2D => WebAPI.CanvasTypes.canvasRenderingContext2DSettingsParameters
Return type
WebAPI.CanvasTypes.canvasRenderingContext2DSettingsgetFillStyle
let getFillStyle: WebAPI.DOM.canvasRenderingContext2D => WebAPI.CanvasTypes.fillStylegetImageData
let getImageData: ( WebAPI.DOM.canvasRenderingContext2D, ~sx: int, ~sy: int, ~sw: int, ~sh: int, ~settings: WebAPI.DOM.imageDataSettings=?,) => WebAPI.DOM.imageDatagetLineDash
let getLineDash: WebAPI.DOM.canvasRenderingContext2D => array<float>getTransform
let getTransform: WebAPI.DOM.canvasRenderingContext2D => WebAPI.DOM.domMatrixisContextLost
let isContextLost: WebAPI.DOM.canvasRenderingContext2D => boolisPointInPath
let isPointInPath: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => boolParameters
~x: float
~y: float
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
boolisPointInPath2
let isPointInPath2: ( WebAPI.DOM.canvasRenderingContext2D, ~path: WebAPI.CanvasTypes.path2D, ~x: float, ~y: float, ~fillRule: WebAPI.CanvasTypes.canvasFillRule=?,) => boolParameters
~path: WebAPI.CanvasTypes.path2D
~x: float
~y: float
~fillRule: WebAPI.CanvasTypes.canvasFillRule=?
Return type
boolisPointInStroke
let isPointInStroke: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float,) => boolisPointInStroke2
let isPointInStroke2: ( WebAPI.DOM.canvasRenderingContext2D, ~path: WebAPI.CanvasTypes.path2D, ~x: float, ~y: float,) => boollineTo
let lineTo: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float,) => unitmeasureText
let measureText: ( WebAPI.DOM.canvasRenderingContext2D, string,) => WebAPI.CanvasTypes.textMetricsmoveTo
let moveTo: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float,) => unitputImageData
let putImageData: ( WebAPI.DOM.canvasRenderingContext2D, ~imagedata: WebAPI.DOM.imageData, ~dx: int, ~dy: int,) => unitputImageData2
let putImageData2: ( WebAPI.DOM.canvasRenderingContext2D, ~imagedata: WebAPI.DOM.imageData, ~dx: int, ~dy: int, ~dirtyX: int, ~dirtyY: int, ~dirtyWidth: int, ~dirtyHeight: int,) => unitParameters
~imagedata: WebAPI.DOM.imageData
~dx: int
~dy: int
~dirtyX: int
~dirtyY: int
~dirtyWidth: int
~dirtyHeight: int
Return type
unitquadraticCurveTo
let quadraticCurveTo: ( WebAPI.DOM.canvasRenderingContext2D, ~cpx: float, ~cpy: float, ~x: float, ~y: float,) => unitParameters
~cpx: float
~cpy: float
~x: float
~y: float
Return type
unitrect
let rect: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float,) => unitreset
let reset: WebAPI.DOM.canvasRenderingContext2D => unitresetTransform
let resetTransform: WebAPI.DOM.canvasRenderingContext2D => unitrestore
let restore: WebAPI.DOM.canvasRenderingContext2D => unitrotate
let rotate: (WebAPI.DOM.canvasRenderingContext2D, float) => unitroundRect
let roundRect: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float, ~radii_: array<float>=?,) => unitParameters
~x: float
~y: float
~w: float
~h: float
~radii_: array<float>=?
Return type
unitroundRect2
let roundRect2: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float, ~radii_: array<float>=?,) => unitParameters
~x: float
~y: float
~w: float
~h: float
~radii_: array<float>=?
Return type
unitroundRect3
let roundRect3: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float, ~radii_: array<float>=?,) => unitParameters
~x: float
~y: float
~w: float
~h: float
~radii_: array<float>=?
Return type
unitsave
let save: WebAPI.DOM.canvasRenderingContext2D => unitscale
let scale: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float,) => unitsetFillStyle
let setFillStyle: ( WebAPI.DOM.canvasRenderingContext2D, WebAPI.CanvasTypes.fillStyle,) => unitsetFont
let setFont: (WebAPI.DOM.canvasRenderingContext2D, string) => unitsetLineDash
let setLineDash: (WebAPI.DOM.canvasRenderingContext2D, array<float>) => unitsetTextBaseline
let setTextBaseline: ( WebAPI.DOM.canvasRenderingContext2D, WebAPI.CanvasTypes.canvasTextBaseline,) => unitsetTransform
let setTransform: ( WebAPI.DOM.canvasRenderingContext2D, ~a: float, ~b: float, ~c: float, ~d: float, ~e: float, ~f: float,) => unitParameters
~a: float
~b: float
~c: float
~d: float
~e: float
~f: float
Return type
unitsetTransform2
let setTransform2: ( WebAPI.DOM.canvasRenderingContext2D, ~transform: WebAPI.DOM.domMatrix2DInit=?,) => unitParameters
Return type
unitstroke
let stroke: WebAPI.DOM.canvasRenderingContext2D => unitstroke2
let stroke2: ( WebAPI.DOM.canvasRenderingContext2D, WebAPI.CanvasTypes.path2D,) => unitstrokeRect
let strokeRect: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float, ~w: float, ~h: float,) => unitstrokeText
let strokeText: ( WebAPI.DOM.canvasRenderingContext2D, ~text: string, ~x: float, ~y: float, ~maxWidth: float=?,) => unitParameters
~text: string
~x: float
~y: float
~maxWidth: float=?
Return type
unittransform
let transform: ( WebAPI.DOM.canvasRenderingContext2D, ~a: float, ~b: float, ~c: float, ~d: float, ~e: float, ~f: float,) => unitParameters
~a: float
~b: float
~c: float
~d: float
~e: float
~f: float
Return type
unittranslate
let translate: ( WebAPI.DOM.canvasRenderingContext2D, ~x: float, ~y: float,) => unit