It's not necessary to call this method inside a Canvas.onPaint() event, as Luart calls it already internally.
Canvas:begin() method
Starts drawing operations on the Canvas.
Return value
This function returns no value.Example
local ui = require "ui"
require "canvas"
-- create a simple Window
local win = ui.Window("Canvas.begin() sample", "fixed", 320, 200)
-- create a Canvas
local canvas = ui.Canvas(win)
canvas.align = "all"
canvas.sync = false
win:show()
-- update user interface
repeat
canvas:begin()
canvas:clear(math.random(0xFFFFFF00)+0xFF)
canvas:flip()
ui.update()
sleep(250)
until not win.visible