ImageView

class vanilla.ImageView(posSize, horizontalAlignment='center', verticalAlignment='center', scale='proportional')

A view that displays an image.

posSize Tuple of form (left, top, width, height) representing the position and size of the view.

horizontalAlignment A string representing the desired horizontal alignment of the image in the view. The options are:

“left” Image is aligned left.
“right” Image is aligned right.
“center” Image is centered.

verticalAlignment A string representing the desired vertical alignment of the image in the view. The options are:

“top” Image is aligned top.
“bottom” Image is aligned bottom.
“center” Image is centered.

scale A string representing the desired scale style of the image in the view. The options are:

“porportional” Proportionally scale the image to fit in the view if it is larger than the view.
“fit” Distort the proportions of the image until it fits exactly in the view.
“none” Do not scale the image.
enable(onOff)

Enable or disable the object. onOff should be a boolean.

getNSImageView()

Return the NSImageView that this object wraps.

getPosSize()

The position and size of the object as a tuple of form (left, top, width, height).

isVisible()

Return a bool indicting if the object is visible or not.

move(x, y)

Move the object by x units and y units.

resize(width, height)

Change the size of the object to width and height.

setImage(imagePath=None, imageNamed=None, imageObject=None)

Set the image in the view.

imagePath A file path to an image.

imageNamed The name of an image already load as a NSImage by the application.

imageObject A NSImage object.

Only one of imagePath, imageNamed, imageObject should be set.

setPosSize(posSize)

Set the postion and size of the object.

posSize A tuple of form (left, top, width, height).

show(onOff)

Show or hide the object.

onOff A boolean value representing if the object should be shown or not.