是否可以从LiveCode中截取屏幕截图?

Liv*_*ort 3 image livecode

我希望能够将我的屏幕捕获导入到我的LiveCode应用程序中.

我通常在我的mac上使用以下组合键:cmd+ shift+4

然后导入图像作为控件或引用图像控件中的图像.

set the fileName of image 1 to "/path/to/image.png"
Run Code Online (Sandbox Code Playgroud)

有没有办法直接通过脚本执行此操作,绕过这些额外步骤的需要?

小智 7

on mouseUp
  import snapshot
end mouseUp
Run Code Online (Sandbox Code Playgroud)

请注意,您还可以使用import命令更具体,例如指定整个屏幕,或仅指定堆栈的一个部分或对象.确保检查字典中导入快照命令的所有可能性.

on mouseUp
  import snapshot from line 1 of the screenrects
  import snapshot from me
end mouseUp
Run Code Online (Sandbox Code Playgroud)