Picture:constructor(parent, image, [x], [y], [width], [height])constructor


The Picture constructor returns a Picture object representing a static image on the parent object.

Parameters

parent

An object that will own the Picture. Parent objects can be any of Window, Groupbox, TabItem and Panel

image

A File object or a filename string, representing the image to be loaded.

[x]

An optional number that indicates the Picture horizontal position, in pixels. Zero means the left border of the parent.

[y]

An optional number that indicates the Picture vertical position, in pixels. Zero means the top border of the parent.

[width]

An optional number that indicates the Picture width in pixels, autosized to fit text content if omitted.
Defaults to the image width if not provided.

[height]

An optional number that indicates the Picture height in pixels, autosized to fit text content if omitted.
Defaults to the image height if not provided.

Return value

The constructor returns a new Picture instance.

Example

--! luart-extensions import ui -- create a simple window local win = ui.Window("Picture.constructor() sample", 340, 180) local picture = ui.Picture(win, "examples/LuaRT.png", -74) win:show() repeat ui.update() until win.visible == false