edifice.Image#

class edifice.Image(src, aspect_ratio_mode=None, **kwargs)[source]#

Bases: QtWidgetElement

Render an image.

Props

All props from QtWidgetElement, plus:

Parameters:
  • src (str | QImage | QPixmap) –

    One of:

  • aspect_ratio_mode (Optional[AspectRatioMode]) –

    The aspect ratio mode of the image.

    • None for a fixed image which doesn’t scale.

    • An AspectRatioMode to specify how the image should scale.

Usage

To render a 3-dimensional uint8 numpy array as an image, see edifice.extra.numpy_image.NumpyImage.

Methods

__init__(src[, aspect_ratio_mode])

register_ref(reference)

Registers provided Reference to this Element.

set_key(key)

Set the key of an Element.

Attributes

children

The children of this Element.

props

The props of this Element.

underlying

The underlying QWidget, which may not exist if this Element has not rendered.