enable.primitives.image module

Defines the Image component class.

class enable.primitives.image.Image(data, **traits)[source]

Bases: enable.component.Component

Component that displays a static image

This is extremely simple right now. By default it will draw the array into the entire region occupied by the component, stretching or shrinking as needed. By default the bounds are set to the width and height of the data array, and we provide the same information to constraints-based layout with the layout_size_hint trait.

data = Array(shape=(None, None, (3, 4)), dtype="uint8")

the image data as an array

format = Property(Enum("rgb24", "rgba32"), observe="data")

the format of the image data (eg. RGB vs. RGBA)

classmethod from_file(filename, **traits)[source]
layout_size_hint = Property(data, observe="data")

the size-hint for constraints-based layout