问题
Is there any way to grab a screenshot of the currently active screen in webos programmatically?
The use-case is an app that takes a screen shot every few seconds for recording user activity.
EDIT: I'm interested in code that actually runs on the device.
回答1:
There's a private service bus API to grab a screenshot that you can use from the shell via luna-send:
luna-send -n 1 luna://com.palm.systemmanager/takeScreenShot '{"file":"sshot.png"}'
This won't work from a non-com.palm application, so it's possible to do this in homebrew, but not in a catalog app.
来源:https://stackoverflow.com/questions/6419662/grabbing-a-screenshot-programmatically-in-webos