When changing the Picture.height property, the image expands/shrinks accordingly.
Picture.height read/write property
Get or set the height of the Picture area. The height starts from 0 (top side of the Picture) and increase to the bottom direction.
Example
local ui = require "ui"
-- create a simple Window
local win = ui.Window("Picture.width sample", 500, 400)
local picture = ui.Picture(win, "examples/LuaRT.png")
local inc_btn = ui.Button(win, "Increase Picture.height", 110, 360)
local dec_btn = ui.Button(win, "Decrease Picture.height", inc_btn.x+150, inc_btn.y)
local function onClick(self)
local delta
if self == inc_btn then
delta = 10
else
delta = -10
end
picture.height = picture.height + delta
end
inc_btn.onClick = onClick
dec_btn.onClick = onClick
-- shows the Window
win:show()
-- update user interface
repeat
ui.update()
until not win.visible