CanvasRenderingContext2D 类
- 实现类型
-
- 注解
-
- @Native("CanvasRenderingContext2D")
方法
-
addHitRegion([Map? options]) → void
-
-
arc(num x, num y, num radius, num startAngle, num endAngle, [bool anticlockwise = false]) → void
-
-
arcTo(num x1, num y1, num x2, num y2, num radius) → void
-
-
beginPath() → void
-
-
bezierCurveTo(num cp1x, num cp1y, num cp2x, num cp2y, num x, num y) → void
-
-
clearHitRegions() → void
-
-
clearRect(num x, num y, num width, num height) → void
-
-
clip([dynamic path_OR_winding, String? winding]) → void
-
-
closePath() → void
-
-
createImageData(dynamic data_OR_imagedata_OR_sw, [int? sh_OR_sw, dynamic imageDataColorSettings_OR_sh, Map? imageDataColorSettings]) → ImageData
-
-
createImageDataFromImageData(ImageData imagedata) → ImageData
-
-
createLinearGradient(num x0, num y0, num x1, num y1) → CanvasGradient
-
-
createPattern(Object image, String repetitionType) → CanvasPattern?
-
-
createPatternFromImage(ImageElement image, String repetitionType) → CanvasPattern
-
-
createRadialGradient(num x0, num y0, num r0, num x1, num y1, num r1) → CanvasGradient
-
-
drawFocusIfNeeded(dynamic element_OR_path, [Element? element]) → void
-
-
drawImage(CanvasImageSource source, num destX, num destY) → void
- 从 CanvasImageSource 到此画布绘制图像。
-
drawImageScaled(CanvasImageSource source, num destX, num destY, num destWidth, num destHeight) → void
- 从 CanvasImageSource 到此画布的某个区域绘制图像。
-
drawImageScaledFromSource(CanvasImageSource source, num sourceX, num sourceY, num sourceWidth, num sourceHeight, num destX, num destY, num destWidth, num destHeight) → void
- 从 CanvasImageSource 到此画布的某个区域绘制图像。
-
drawImageToRect(CanvasImageSource source, Rectangle<num> destRect, {Rectangle<num>? sourceRect}) → void
- 从 CanvasImageSource 到此画布的某个区域绘制图像。
-
ellipse(num x, num y, num radiusX, num radiusY, num rotation, num startAngle, num endAngle, bool? anticlockwise) → void
-
-
fill([dynamic path_OR_winding, String? winding]) → void
-
-
fillRect(num x, num y, num width, num height) → void
-
-
fillText(String text, num x, num y, [num? maxWidth]) → void
- 在画布上绘制文本。
-
getContextAttributes() → Map
-
-
getImageData(int sx, int sy, int sw, int sh) → ImageData
-
-
getLineDash() → List<num>
-
-
isContextLost() → bool
-
-
isPointInPath(dynamic path_OR_x, num x_OR_y, [dynamic winding_OR_y, String? winding]) → bool
-
-
isPointInStroke(dynamic path_OR_x, num x_OR_y, [num? y]) → bool
-
-
lineTo(num x, num y) → void
-
-
measureText(String text) → TextMetrics
-
-
moveTo(num x, num y) → void
-
-
noSuchMethod(Invocation invocation) → dynamic
- 调用不存在的方法或属性时触发。
继承
-
putImageData(ImageData imagedata, int dx, int dy, [int? dirtyX, int? dirtyY, int? dirtyWidth, int? dirtyHeight]) → void
-
-
quadraticCurveTo(num cpx, num cpy, num x, num y) → void
-
-
rect(num x, num y, num width, num height) → void
-
-
removeHitRegion(String id) → void
-
-
resetTransform() → void
-
-
restore() → void
-
-
rotate(num angle) → void
-
-
save() → void
-
-
scale(num x, num y) → void
-
-
scrollPathIntoView([Path2D? path]) → void
-
-
setFillColorHsl(int h, num s, num l, [num a = 1]) → void
- 设置形状内部的填充颜色。参数
h
以度为单位,取值范围为 0-360。参数 s
和 l
以百分比为单位,取值范围为 0-100。参数 a
取值范围为 0-1。
-
setFillColorRgb(int r, int g, int b, [num a = 1]) → void
- 设置形状内部的填充颜色。参数
r
、g
和 b
的取值范围为 0-255,参数 a
的取值范围为 0-1。
-
setLineDash(List<num> dash) → void
-
-
setStrokeColorHsl(int h, num s, num l, [num a = 1]) → void
- 设置用于描边形状的颜色。参数
h
以度为单位,取值范围为 0-360。参数 s
和 l
以百分比为单位,取值范围为 0-100。参数 a
取值范围为 0-1。
-
setStrokeColorRgb(int r, int g, int b, [num a = 1]) → void
- 设置用于描边形状的颜色。参数
r
、g
和 b
的取值范围为 0-255,参数 a
的取值范围为 0-1。
-
setTransform(num a, num b, num c, num d, num e, num f) → void
-
-
stroke([Path2D? path]) → void
-
-
strokeRect(num x, num y, num width, num height) → void
-
-
strokeText(String text, num x, num y, [num? maxWidth]) → void
-
-
toString() → String
- 该对象的字符串表示。
继承
-
transform(num a, num b, num c, num d, num e, num f) → void
-
-
translate(num x, num y) → void
-