Skip to main content

Image

Draws an image.

Inherits: canvas.Shape

Properties

  • height - The height of the rectangle to draw the image into.
  • paint - A paint to composite the image into canvas.
  • src - Draws an image from a source.
  • width - The width of the rectangle to draw the image into.
  • x - The x-axis coordinate of the image's top-left corner.
  • y - The y-axis coordinate of the image's top-left corner.

Properties

heightclass-attributeinstance-attribute

height: Number | None = None

The height of the rectangle to draw the image into. Use image height if None.

paintclass-attributeinstance-attribute

paint: Paint | None = None

A paint to composite the image into canvas.

srcclass-attributeinstance-attribute

src: str | bytes | None = None

Draws an image from a source.

Accepts URLs/paths, base64 strings, or raw bytes.

widthclass-attributeinstance-attribute

width: Number | None = None

The width of the rectangle to draw the image into. Use image width if None.

xclass-attributeinstance-attribute

x: Number | None = None

The x-axis coordinate of the image's top-left corner.

yclass-attributeinstance-attribute

y: Number | None = None

The y-axis coordinate of the image's top-left corner.