enaml.widgets.image_view

Classes

ImageView

A widget which can display an Image with optional scaling.

class enaml.widgets.image_view.ImageView(parent=None, **kwargs)[source]

Bases: enaml.widgets.control.Control

A widget which can display an Image with optional scaling.

image

The image to display in the viewer.

scale_to_fit

Whether or not to scale the image with the size of the component.

allow_upscaling

Whether to allow upscaling of an image if scale_to_fit is True.

preserve_aspect_ratio

Whether or not to preserve the aspect ratio if scaling the image.

hug_width

An image view hugs its width weakly by default.

hug_height

An image view hugs its height weakly by default.

proxy

A reference to the ProxyImageView object.

layout_constraints()[source]

Add constraints to preserve the aspect ratio.