mirror of
https://github.com/openharmony/applications_screenshot.git
synced 2026-07-01 20:39:36 -04:00
+3
-3
@@ -4,9 +4,9 @@
|
||||
{
|
||||
"name": "default",
|
||||
"signingConfig": "release",
|
||||
"compileSdkVersion": 18,
|
||||
"compatibleSdkVersion": 18,
|
||||
"targetSdkVersion": 18,
|
||||
"compileSdkVersion": 20,
|
||||
"compatibleSdkVersion": 20,
|
||||
"targetSdkVersion": 20,
|
||||
"runtimeOS": "OpenHarmony",
|
||||
}
|
||||
],
|
||||
|
||||
@@ -39,6 +39,7 @@ export class ScreenShotModel {
|
||||
|
||||
async shotScreen() {
|
||||
Log.showInfo(TAG, 'shotScreen');
|
||||
WindowMar.notifyScreenshotEvent(WindowMar.ScreenshotEventType.SYSTEM_SCREENSHOT);
|
||||
await new Promise<number>((resolve) => setTimeout(resolve, CREATE_WINDOW_DELAY));
|
||||
ScreenshotManager.save().then(async (data) => {
|
||||
Log.showInfo(TAG, `ScreenshotManager.save data:${JSON.stringify(data)}`);
|
||||
@@ -49,8 +50,11 @@ export class ScreenShotModel {
|
||||
format: 'image/jpeg',
|
||||
quality: OPTIONS_QUALITY,
|
||||
});
|
||||
} else {
|
||||
WindowMar.notifyScreenshotEvent(WindowMar.ScreenshotEventType.SYSTEM_SCREENSHOT_ABORT);
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
WindowMar.notifyScreenshotEvent(WindowMar.ScreenshotEventType.SYSTEM_SCREENSHOT);
|
||||
Log.showInfo(TAG, `ScreenshotManager.save err:${JSON.stringify(err)}`);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user