Node based canvas creation

Hierarchy

  • CanvasKitCanvasAdapter

Implements

Constructors

Properties

canvasKitWasmLocateFile: ((filename: string) => string) = ...

Type declaration

    • (filename: string): string
    • Parameters

      • filename: string

      Returns string

Methods

  • Create a canvas with dimensions set to the provided width and height

    Returns

    canvas

    Parameters

    • width: number
    • height: number

    Returns EmulatedCanvas2D

  • 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>

  • Parameters

    • locateFile: ((filename: string) => string)
        • (filename: string): string
        • Parameters

          • filename: string

          Returns string

    Returns void

Generated using TypeDoc