Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ICanvasContext2D

Hierarchy

  • CanvasState
  • CanvasTransform
  • CanvasCompositing
  • CanvasImageSmoothing
  • CanvasFillStrokeStyles
  • CanvasShadowStyles
  • CanvasFilters
  • CanvasRect
  • CanvasDrawPath
  • CanvasText
  • CanvasDrawImage
  • CanvasImageData
  • CanvasPathDrawingStyles
  • CanvasTextDrawingStyles
  • CanvasPath
    • ICanvasContext2D

Index

Properties

direction

direction: CanvasDirection

fillStyle

fillStyle: string | CanvasGradient | CanvasPattern

filter

filter: string

font

font: string

globalAlpha

globalAlpha: number

globalCompositeOperation

globalCompositeOperation: string

imageSmoothingEnabled

imageSmoothingEnabled: boolean

imageSmoothingQuality

imageSmoothingQuality: ImageSmoothingQuality

lineCap

lineCap: CanvasLineCap

lineDashOffset

lineDashOffset: number

lineJoin

lineJoin: CanvasLineJoin

lineWidth

lineWidth: number

miterLimit

miterLimit: number

shadowBlur

shadowBlur: number

shadowColor

shadowColor: string

shadowOffsetX

shadowOffsetX: number

shadowOffsetY

shadowOffsetY: number

strokeStyle

strokeStyle: string | CanvasGradient | CanvasPattern

textAlign

textAlign: CanvasTextAlign

textBaseline

textBaseline: CanvasTextBaseline

Methods

arc

  • arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: undefined | false | true): void
  • Parameters

    • x: number
    • y: number
    • radius: number
    • startAngle: number
    • endAngle: number
    • Optional anticlockwise: undefined | false | true

    Returns void

arcTo

  • arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
  • Parameters

    • x1: number
    • y1: number
    • x2: number
    • y2: number
    • radius: number

    Returns void

beginPath

  • beginPath(): void
  • Returns void

bezierCurveTo

  • bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void
  • Parameters

    • cp1x: number
    • cp1y: number
    • cp2x: number
    • cp2y: number
    • x: number
    • y: number

    Returns void

clearRect

  • clearRect(x: number, y: number, w: number, h: number): void
  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

clip

  • clip(fillRule?: CanvasFillRule): void
  • clip(path: Path2D, fillRule?: CanvasFillRule): void
  • Parameters

    • Optional fillRule: CanvasFillRule

    Returns void

  • Parameters

    • path: Path2D
    • Optional fillRule: CanvasFillRule

    Returns void

closePath

  • closePath(): void
  • Returns void

createImageData

  • createImageData(sw: number, sh: number): ImageData
  • createImageData(imagedata: ImageData): ImageData
  • Parameters

    • sw: number
    • sh: number

    Returns ImageData

  • Parameters

    • imagedata: ImageData

    Returns ImageData

createLinearGradient

  • createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient
  • Parameters

    • x0: number
    • y0: number
    • x1: number
    • y1: number

    Returns CanvasGradient

createPattern

  • createPattern(image: CanvasImageSource, repetition: string): CanvasPattern | null
  • Parameters

    • image: CanvasImageSource
    • repetition: string

    Returns CanvasPattern | null

createRadialGradient

  • createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number, r1: number): CanvasGradient
  • Parameters

    • x0: number
    • y0: number
    • r0: number
    • x1: number
    • y1: number
    • r1: number

    Returns CanvasGradient

drawImage

  • drawImage(image: CanvasImageSource, dx: number, dy: number): void
  • drawImage(image: CanvasImageSource, dx: number, dy: number, dw: number, dh: number): void
  • drawImage(image: CanvasImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void
  • Parameters

    • image: CanvasImageSource
    • dx: number
    • dy: number

    Returns void

  • Parameters

    • image: CanvasImageSource
    • dx: number
    • dy: number
    • dw: number
    • dh: number

    Returns void

  • Parameters

    • image: CanvasImageSource
    • sx: number
    • sy: number
    • sw: number
    • sh: number
    • dx: number
    • dy: number
    • dw: number
    • dh: number

    Returns void

ellipse

  • ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number, startAngle: number, endAngle: number, anticlockwise?: undefined | false | true): void
  • Parameters

    • x: number
    • y: number
    • radiusX: number
    • radiusY: number
    • rotation: number
    • startAngle: number
    • endAngle: number
    • Optional anticlockwise: undefined | false | true

    Returns void

fill

  • fill(fillRule?: CanvasFillRule): void
  • fill(path: Path2D, fillRule?: CanvasFillRule): void
  • Parameters

    • Optional fillRule: CanvasFillRule

    Returns void

  • Parameters

    • path: Path2D
    • Optional fillRule: CanvasFillRule

    Returns void

fillRect

  • fillRect(x: number, y: number, w: number, h: number): void
  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

fillText

  • fillText(text: string, x: number, y: number, maxWidth?: undefined | number): void
  • Parameters

    • text: string
    • x: number
    • y: number
    • Optional maxWidth: undefined | number

    Returns void

getImageData

  • getImageData(sx: number, sy: number, sw: number, sh: number): ImageData
  • Parameters

    • sx: number
    • sy: number
    • sw: number
    • sh: number

    Returns ImageData

getLineDash

  • getLineDash(): number[]
  • Returns number[]

getTransform

  • getTransform(): DOMMatrix
  • Returns DOMMatrix

isPointInPath

  • isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean
  • isPointInPath(path: Path2D, x: number, y: number, fillRule?: CanvasFillRule): boolean
  • Parameters

    • x: number
    • y: number
    • Optional fillRule: CanvasFillRule

    Returns boolean

  • Parameters

    • path: Path2D
    • x: number
    • y: number
    • Optional fillRule: CanvasFillRule

    Returns boolean

isPointInStroke

  • isPointInStroke(x: number, y: number): boolean
  • isPointInStroke(path: Path2D, x: number, y: number): boolean
  • Parameters

    • x: number
    • y: number

    Returns boolean

  • Parameters

    • path: Path2D
    • x: number
    • y: number

    Returns boolean

lineTo

  • lineTo(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

measureText

  • measureText(text: string): TextMetrics
  • Parameters

    • text: string

    Returns TextMetrics

moveTo

  • moveTo(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

putImageData

  • putImageData(imagedata: ImageData, dx: number, dy: number): void
  • putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX: number, dirtyY: number, dirtyWidth: number, dirtyHeight: number): void
  • Parameters

    • imagedata: ImageData
    • dx: number
    • dy: number

    Returns void

  • Parameters

    • imagedata: ImageData
    • dx: number
    • dy: number
    • dirtyX: number
    • dirtyY: number
    • dirtyWidth: number
    • dirtyHeight: number

    Returns void

quadraticCurveTo

  • quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
  • Parameters

    • cpx: number
    • cpy: number
    • x: number
    • y: number

    Returns void

rect

  • rect(x: number, y: number, w: number, h: number): void
  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

resetTransform

  • resetTransform(): void
  • Returns void

restore

  • restore(): void
  • Returns void

rotate

  • rotate(angle: number): void
  • Parameters

    • angle: number

    Returns void

save

  • save(): void
  • Returns void

scale

  • scale(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

setLineDash

  • setLineDash(segments: number[]): void
  • Parameters

    • segments: number[]

    Returns void

setTransform

  • setTransform(a: number, b: number, c: number, d: number, e: number, f: number): void
  • setTransform(transform?: DOMMatrix2DInit): void
  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

  • Parameters

    • Optional transform: DOMMatrix2DInit

    Returns void

stroke

  • stroke(): void
  • stroke(path: Path2D): void
  • Returns void

  • Parameters

    • path: Path2D

    Returns void

strokeRect

  • strokeRect(x: number, y: number, w: number, h: number): void
  • Parameters

    • x: number
    • y: number
    • w: number
    • h: number

    Returns void

strokeText

  • strokeText(text: string, x: number, y: number, maxWidth?: undefined | number): void
  • Parameters

    • text: string
    • x: number
    • y: number
    • Optional maxWidth: undefined | number

    Returns void

transform

  • transform(a: number, b: number, c: number, d: number, e: number, f: number): void
  • Parameters

    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number

    Returns void

translate

  • translate(x: number, y: number): void
  • Parameters

    • x: number
    • y: number

    Returns void

Generated using TypeDoc