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: Optional[Number] = None

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

paintclass-attributeinstance-attribute

paint: Optional[Paint] = None

A paint to composite the image into canvas.

srcclass-attributeinstance-attribute

src: Optional[Union[str, bytes]] = None

Draws an image from a source.

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

widthclass-attributeinstance-attribute

width: Optional[Number] = None

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

xclass-attributeinstance-attribute

x: Optional[Number] = None

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

yclass-attributeinstance-attribute

y: Optional[Number] = None

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