Interface: ICanvasRenderingContext2D

ICanvasRenderingContext2D

Common interface for CanvasRenderingContext2D, OffscreenCanvasRenderingContext2D, and other custom canvas 2D context.

Properties:
Name Type Description
letterSpacing string

sets the horizontal spacing behavior between text characters.

textLetterSpacing string

sets the horizontal spacing behavior between text characters.

Extends

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

Members

letterSpacing string

sets the horizontal spacing behavior between text characters.

textLetterSpacing string

sets the horizontal spacing behavior between text characters.

Methods

createPattern (image, repetition) CanvasPattern | null

creates a pattern using the specified image and repetition.

Name Type Description
image CanvasImageSource | ICanvas
repetition string | null
Returns:
Type Description
CanvasPattern | null

drawImage (image, dx, dy) void

provides different ways to draw an image onto the canvas

Name Type Description
image CanvasImageSource | ICanvas
dx number
dy number