Image.width readonly property
Get the Image width. The width starts from 0 (left side of the Image) and increases to the right direction.
Example
local ui = require "ui"
require "canvas"
-- create a simple Window
local win = ui.Window("Image.Image() sample", "fixed", 320, 200)
-- create a Canvas
local canvas = ui.Canvas(win)
canvas.align = "all"
local img = canvas:Image("LuaRT.png")
local xpos = -img.width
function canvas:onPaint()
self:begin()
self:clear()
img:draw(xpos, 30)
xpos = xpos > canvas.width and -img.width or xpos+6
self:flip()
end
ui.run(win):wait()