| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 3 个月前 | ||
| 1 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 5 个月前 | ||
| 3 个月前 | ||
| 10 天前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 | ||
| 3 个月前 |
snapshot简介
介绍
本示例演示在Stage模型下获取窗口截图。应用启动后获取主窗口对象,并调用窗口截图接口获取当前窗口内容。
效果预览

使用说明
- 启动应用。
- 应用在创建主窗口后获取Window对象。
- 调用snapshot接口获取窗口截图。
工程目录
entry/src/main/ets/
|---entryability
| |---EntryAbility.ets
|---entrybackupability
|---pages
| |---Index.ets
具体实现
窗口截图在EntryAbility中实现,源码参考:EntryAbility.ets。
目标页面在Index中实现,源码参考:Index.ets。
相关权限
不涉及。
依赖
不涉及。
约束与限制
- 本示例仅支持标准系统上运行。
- 本示例为Stage模型。
- sdk: 23 deveco: 6.1.0 Release
下载
git init
git config core.sparsecheckout true
echo code/DocsSample/ArkUISample/ArkUIWindowSamples/snapshot > .git/info/sparse-checkout
git remote add origin https://gitcode.com/openharmony/applications_app_samples.git
git pull origin master