WsImage:
Filter:
WsGUI/Classes (extension) | GUI > WsGUI | Extensions

WsImage
ExtensionExtension

Widget displaying an image in WsGUI.

Description

Displays an image in WsWindow.

This can be any image file supported by the web browser. It can be stored locally or on the network.

Internally, local files are symlinked to current WsWindow's working directory, so they can be placed anywhere in the filesystem.

Class Methods

.new

Create new instance and add it to the window immediately.

.init

Create new instance without adding it to the window. Use this when using WsLayout.

Arguments:

wsWindow

An instance of WsWindow

bounds

A Rect specifying the size of the widget.

NOTE: 0 provided for width or height will preserve image's aspect ratio.

NOTE: Currently a relative measurement is used: 1 for full window width, 1 for full window height, e.g. Rect(0, 0, 1, 1) would occupy whole window.
path

Path to a file. Optional at initialization.

isURL

When set to true, path is treated as an URL (no symlink is created).

Returns:

an instance of the widget

Instance Methods

.path

Get/set the path to an image file.

Arguments:

newPath

String representing path to a file or an URL (see below).

isURL

When set to true, path is treated as an URL (no symlink is created).

Returns:

current path

Examples