Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Experimental WebAPI
GitHub

CanvasAPI

Types

canvasDirection

typecanvasDirection=
| @as("inherit")Inherit
| @as("ltr")Ltr
| @as("rtl")Rtl

canvasFillRule

typecanvasFillRule=
| @as("evenodd")Evenodd
| @as("nonzero")Nonzero

canvasFontKerning

typecanvasFontKerning=
| @as("auto")Auto
| @as("none")None
| @as("normal")Normal

canvasFontStretch

typecanvasFontStretch=
| @as("condensed")Condensed
| @as("expanded")Expanded
| @as("extra-condensed")ExtraCondensed
| @as("extra-expanded")ExtraExpanded
| @as("normal")Normal
| @as("semi-condensed")SemiCondensed
| @as("semi-expanded")SemiExpanded
| @as("ultra-condensed")UltraCondensed
| @as("ultra-expanded")UltraExpanded

canvasFontVariantCaps

typecanvasFontVariantCaps=
| @as("all-petite-caps")AllPetiteCaps
| @as("all-small-caps")AllSmallCaps
| @as("normal")Normal
| @as("petite-caps")PetiteCaps
| @as("small-caps")SmallCaps
| @as("titling-caps")TitlingCaps
| @as("unicase")Unicase

canvasGradient

An opaque object describing a gradient. It is returned by the methods CanvasRenderingContext2D.createLinearGradient() or CanvasRenderingContext2D.createRadialGradient().See CanvasGradient on MDN

typecanvasGradient= {}

Module

There are methods and helpers defined in CanvasGradient.

canvasLineCap

typecanvasLineCap=
| @as("butt")Butt
| @as("round")Round
| @as("square")Square

canvasLineJoin

typecanvasLineJoin=
| @as("bevel")Bevel
| @as("miter")Miter
| @as("round")Round

canvasPattern

An opaque object describing a pattern, based on an image, a canvas, or a video, created by the CanvasRenderingContext2D.createPattern() method.See CanvasPattern on MDN

typecanvasPattern= {}

Module

There are methods and helpers defined in CanvasPattern.

canvasRenderingContext2DSettings

typecanvasRenderingContext2DSettings= {
mutablealpha?:bool,
mutabledesynchronized?:bool,
mutablecolorSpace?:predefinedColorSpace,
mutablewillReadFrequently?:bool,
}

Record fields

alpha
option< bool >
desynchronized
option< bool >
colorSpace
willReadFrequently
option< bool >

canvasTextAlign

typecanvasTextAlign=
| @as("center")Center
| @as("end")End
| @as("left")Left
| @as("right")Right
| @as("start")Start

canvasTextBaseline

typecanvasTextBaseline=
| @as("alphabetic")Alphabetic
| @as("bottom")Bottom
| @as("hanging")Hanging
| @as("ideographic")Ideographic
| @as("middle")Middle
| @as("top")Top

canvasTextRendering

typecanvasTextRendering=
| @as("auto")Auto
| @as("geometricPrecision")GeometricPrecision
| @as("optimizeLegibility")OptimizeLegibility
| @as("optimizeSpeed")OptimizeSpeed

fillStyle

typefillStyle

Module

There are methods and helpers defined in FillStyle.

globalCompositeOperation

typeglobalCompositeOperation=
| @as("color")Color
| @as("color-burn")ColorBurn
| @as("color-dodge")ColorDodge
| @as("copy")Copy
| @as("darken")Darken
| @as("destination-atop")DestinationAtop
| @as("destination-in")DestinationIn
| @as("destination-out")DestinationOut
| @as("destination-over")DestinationOver
| @as("difference")Difference
| @as("exclusion")Exclusion
| @as("hard-light")HardLight
| @as("hue")Hue
| @as("lighten")Lighten
| @as("lighter")Lighter
| @as("luminosity")Luminosity
| @as("multiply")Multiply
| @as("overlay")Overlay
| @as("saturation")Saturation
| @as("screen")Screen
| @as("soft-light")SoftLight
| @as("source-atop")SourceAtop
| @as("source-in")SourceIn
| @as("source-out")SourceOut
| @as("source-over")SourceOver
| @as("xor")Xor

imageBitmap

typeimageBitmap= {width:int,height:int}

Record fields

width
int

Returns the intrinsic width of the image, in CSS pixels.Read more on MDN

height
int

Returns the intrinsic height of the image, in CSS pixels.Read more on MDN

Module

There are methods and helpers defined in ImageBitmap.

imageBitmapRenderingContext

typeimageBitmapRenderingContext= {canvas:unknown}

Record fields

canvas
unknown

Returns the canvas element that the context is bound to.Read more on MDN

Module

There are methods and helpers defined in ImageBitmapRenderingContext.

imageBitmapRenderingContextSettings

typeimageBitmapRenderingContextSettings= {
mutablealpha?:bool,
}

Record fields

alpha
option< bool >

imageEncodeOptions

typeimageEncodeOptions= {
mutabletype_?:string,
mutablequality?:float,
}

Record fields

type_
option< string >
quality
option< float >

imageSmoothingQuality

typeimageSmoothingQuality=
| @as("high")High
| @as("low")Low
| @as("medium")Medium

offscreenCanvas

typeoffscreenCanvas= {
mutablewidth:int,
mutableheight:int,
}

Record fields

width
int

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).Read more on MDN

height
int

These attributes return the dimensions of the OffscreenCanvas object's bitmap.

They can be set, to replace the bitmap with a new, transparent black bitmap of the specified dimensions (effectively resizing it).Read more on MDN

Module

There are methods and helpers defined in OffscreenCanvas.

offscreenCanvasRenderingContext2D

typeoffscreenCanvasRenderingContext2D= {
canvas:offscreenCanvas,
mutableglobalAlpha:float,
mutableglobalCompositeOperation:globalCompositeOperation,
mutableimageSmoothingEnabled:bool,
mutableimageSmoothingQuality:imageSmoothingQuality,
mutablestrokeStyle:fillStyle,
mutablefillStyle:fillStyle,
mutableshadowOffsetX:float,
mutableshadowOffsetY:float,
mutableshadowBlur:float,
mutableshadowColor:string,
mutablefilter:string,
mutablelineWidth:float,
mutablelineCap:canvasLineCap,
mutablelineJoin:canvasLineJoin,
mutablemiterLimit:float,
mutablelineDashOffset:float,
mutablefont:string,
mutabletextAlign:canvasTextAlign,
mutabletextBaseline:canvasTextBaseline,
mutabledirection:canvasDirection,
mutableletterSpacing:string,
mutablefontKerning:canvasFontKerning,
mutablefontStretch:canvasFontStretch,
mutablefontVariantCaps:canvasFontVariantCaps,
mutabletextRendering:canvasTextRendering,
mutablewordSpacing:string,
}

Record fields

globalAlpha
float
imageSmoothingEnabled
bool
shadowOffsetX
float
shadowOffsetY
float
shadowBlur
float
shadowColor
string
filter
string
lineWidth
float
miterLimit
float
lineDashOffset
float
font
string
letterSpacing
string
wordSpacing
string

offscreenRenderingContext

typeoffscreenRenderingContext=WebAPI.Prelude.any

offscreenRenderingContextId

typeoffscreenRenderingContextId=
| @as("2d")V2d
| @as("bitmaprenderer")Bitmaprenderer
| @as("webgl")Webgl
| @as("webgl2")Webgl2
| @as("webgpu")Webgpu

path2D

This Canvas 2D API interface is used to declare a path that can then be used on a CanvasRenderingContext2D object. The path methods of the CanvasRenderingContext2D interface are also present on this interface, which gives you the convenience of being able to retain and replay your path whenever desired.See Path2D on MDN

typepath2D= {}

Module

There are methods and helpers defined in Path2D.

predefinedColorSpace

typepredefinedColorSpace=
| @as("display-p3")DisplayP3
| @as("srgb")Srgb

textMetrics

The dimensions of a piece of text in the canvas, as created by the CanvasRenderingContext2D.measureText() method.See TextMetrics on MDN

typetextMetrics= {
width:float,
actualBoundingBoxLeft:float,
actualBoundingBoxRight:float,
fontBoundingBoxAscent:float,
fontBoundingBoxDescent:float,
actualBoundingBoxAscent:float,
actualBoundingBoxDescent:float,
emHeightAscent:float,
emHeightDescent:float,
hangingBaseline:float,
alphabeticBaseline:float,
ideographicBaseline:float,
}

Record fields

width
float

Returns the measurement described below.Read more on MDN

actualBoundingBoxLeft
float

Returns the measurement described below.Read more on MDN

actualBoundingBoxRight
float

Returns the measurement described below.Read more on MDN

fontBoundingBoxAscent
float

Returns the measurement described below.Read more on MDN

fontBoundingBoxDescent
float

Returns the measurement described below.Read more on MDN

actualBoundingBoxAscent
float

Returns the measurement described below.Read more on MDN

actualBoundingBoxDescent
float

Returns the measurement described below.Read more on MDN

emHeightAscent
float

Returns the measurement described below.Read more on MDN

emHeightDescent
float

Returns the measurement described below.Read more on MDN

hangingBaseline
float

Returns the measurement described below.Read more on MDN

alphabeticBaseline
float

Returns the measurement described below.Read more on MDN

ideographicBaseline
float

Returns the measurement described below.Read more on MDN

webGL2RenderingContext

typewebGL2RenderingContext= {
canvas:unknown,
drawingBufferWidth:float,
drawingBufferHeight:float,
mutabledrawingBufferColorSpace:predefinedColorSpace,
mutableunpackColorSpace:predefinedColorSpace,
}

Record fields

canvas
unknown
drawingBufferWidth
float
drawingBufferHeight
float

webGLContextAttributes

typewebGLContextAttributes= {
mutablealpha?:bool,
mutabledepth?:bool,
mutablestencil?:bool,
mutableantialias?:bool,
mutablepremultipliedAlpha?:bool,
mutablepreserveDrawingBuffer?:bool,
mutablepowerPreference?:webGLPowerPreference,
mutablefailIfMajorPerformanceCaveat?:bool,
mutabledesynchronized?:bool,
}

Record fields

alpha
option< bool >
depth
option< bool >
stencil
option< bool >
antialias
option< bool >
premultipliedAlpha
option< bool >
preserveDrawingBuffer
option< bool >
powerPreference
failIfMajorPerformanceCaveat
option< bool >
desynchronized
option< bool >

webGLPowerPreference

typewebGLPowerPreference=
| @as("default")Default
| @as("high-performance")HighPerformance
| @as("low-power")LowPower

webGLRenderingContext

Provides an interface to the OpenGL ES 2.0 graphics rendering context for the drawing surface of an HTML <canvas> element.See WebGLRenderingContext on MDN

typewebGLRenderingContext= {
canvas:unknown,
drawingBufferWidth:float,
drawingBufferHeight:float,
mutabledrawingBufferColorSpace:predefinedColorSpace,
mutableunpackColorSpace:predefinedColorSpace,
}

Record fields

canvas
unknown
drawingBufferWidth
float
drawingBufferHeight
float

[8]ページ先頭

©2009-2025 Movatter.jp