Browser based canvas adapter

Hierarchy

  • HtmlCanvasAdapter

Implements

Constructors

Methods

  • Draws text centered at the location specified in the canvas rendering context

    Parameters

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

    Returns void

  • Returns the width of the text in the given font face and font size

    Parameters

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

    Returns number

  • Converts the canvas to a base64 data url in the format specified

    Parameters

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

      0 to 1

    Returns Promise<string>

Generated using TypeDoc