屏幕找图去掉从剪贴板获取图片按钮,添加直接截图获取按钮

This commit is contained in:
fofolee
2025-02-17 15:59:22 +08:00
parent daef39b02a
commit 89a2e07b13
2 changed files with 14 additions and 19 deletions

View File

@@ -115,15 +115,15 @@ async function captureScreen(range = "fullscreen") {
}
async function captureScreenToFile(range = "fullscreen", path = null) {
if (!path) return null;
if (!path) return;
const result = await captureScreen(range);
if (!result) return null;
if (!result) return;
fs.writeFileSync(
path,
result.replace("data:image/png;base64,", ""),
"base64"
);
return result;
return;
}
async function captureScreenToClipboard(range = "fullscreen") {