Skip to content

Commit 318e069

Browse files
committed
Update takeScreenshot documentation for Android
Change-Id: Ia32249d5ca23dbe8aa8b026f2dfd82776fe56b4a
1 parent 7f69dda commit 318e069

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

docs/en/api/elements/built-in/view.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ lynx
650650
params: {
651651
format: 'jpeg', // Specify the image format, supports jpeg and png, the default is jpeg.
652652
scale: 0.5, // Specify the image quality, 0 < scale <= 1, the default is 1, the smaller the value, the blurrier and smaller the size.
653+
androidEnablePixelCopy: false, // Specify whether to use PixelCopy to take screenshots on Android, the default is false.
653654
},
654655
success: function (res) {
655656
console.log(res);
@@ -666,7 +667,7 @@ The front end can call this method to obtain the base64 image of the target node
666667
:::tip
667668
This operation will take up time in the main thread, so you need to pay attention to the calling frequency.
668669

669-
When used on Android, you need to set [`flatten`](#flatten) to `false` on the corresponding node.
670+
On Android, you must set [`flatten`](#flatten) to `false` on the target node. For SDK versions 3.5 and newer, you can enable screenshots via [PixelCopy](https://developer.android.com/reference/android/view/PixelCopy) by setting the `androidEnablePixelCopy` parameter, which solves the issue of inability to take screenshots in Video/Surface nodes.
670671
:::
671672

672673
### `requestAccessibilityFocus`

docs/zh/api/elements/built-in/view.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ lynx
654654
params: {
655655
format: 'jpeg', // 指定图片格式,支持 jpeg、png,默认为 jpeg
656656
scale: 0.5, // 指定图片质量,0 < scale <= 1,默认为 1,越小越模糊,体积也越小
657+
androidEnablePixelCopy: false, // 指定 Android 上是否用 PixelCopy 方式截图,默认为 false
657658
},
658659
success: function (res) {
659660
console.log(res);
@@ -670,7 +671,7 @@ lynx
670671
:::tip
671672
该操作会占用主线程耗时,需要注意调用频率。
672673

673-
Android 上使用时需要在对应节点设置 [`flatten`](#flatten)`false`
674+
Android 上使用时需要在对应节点设置 [`flatten`](#flatten)`false`在 SDK 版本大于等于 3.5 支持 `androidEnablePixelCopy`[PixelCopy](https://developer.android.com/reference/android/view/PixelCopy)方式截图,解决 Video/Surface 场景无法截图的问题。
674675
:::
675676

676677
### `requestAccessibilityFocus`

0 commit comments

Comments
 (0)