widget only
This event is only available when the
ui module is loaded before capture and Camera is used as a widget.Camera:onClick()event
This event is fired when the user left-clicks on the Camera widget.
Return value
The event returns no value.Example
--! luart-extensions
import ui, capture
local win = ui.Window("Camera:onClick() sample", "fixed", 640, 520)
local cam = ui.Camera(win, 10, 10, 620, 460)
function cam:onClick()
-- Take a snapshot on click
cam:snapshot("click_snapshot.png")
print("Snapshot taken!")
end
await win:showasync()