Canvas Wrapper Class for interacting with HTMLCanvas and CanvasKit

Hierarchy

  • Canvas

Constructors

Methods

  • Parameters

    • width: any
    • height: any

    Returns HTMLCanvasElement

  • Parameters

    • width: any
    • height: any

    Returns ImageData

  • Parameters

    • context: CanvasRenderingContext2D
    • text: string
    • location: number[]
    • fontFace: string
    • fontSize: number
    • fontColor: string

    Returns void

  • Parameters

    • context: CanvasRenderingContext2D
    • fontFace: string
    • fontSize: number
    • text: string

    Returns number

  • Draw content of fromCanvas into the toContext

    Parameters

    • fromCanvas: any
    • toContext: any

    Returns void

  • Returns the byte array representing the drawn content of a canvas.

    Parameters

    • canvas: any
    • imageFormat: ImageType = ImageType.PNG
    • Optional compressionQuality: number

    Returns Promise<Uint8Array>

  • Parameters

    • canvas: any
    • format: string = 'image/png'
    • Optional quality: number

    Returns Promise<string>

Generated using TypeDoc