Skip to content

Latest commit

 

History

History
149 lines (110 loc) · 5.57 KB

README-ZH.md

File metadata and controls

149 lines (110 loc) · 5.57 KB

screen_capturer

pub version All Contributors

这个插件允许 Flutter 桌面应用程序进行屏幕截图。


English | 简体中文


平台支持

Linux macOS Windows
✔️ ✔️ ✔️

快速开始

安装

将此添加到你的软件包的 pubspec.yaml 文件:

dependencies:
  screen_capturer: ^0.2.3

dependencies:
  screen_capturer:
    git:
      path: packages/screen_capturer
      url: https://github.com/leanflutter/screen_capturer.git
      ref: main

Windows requirements

请务必修改你的 Visual Studio 安装,并确保 "C++ ATL for latest v142 build tools (x86 & x64)" 已安装

用法

macOS

更改文件 macos/Runner/DebugProfile.entitlementsmacos/Runner/Release.entitlements 如下:

仅在沙盒模式下需要。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>com.apple.security.app-sandbox</key>
	<true/>
+	<key>com.apple.security.temporary-exception.mach-register.global-name</key>
+	<string>com.apple.screencapture.interactive</string>
</dict>
</plist>
import 'package:screen_capturer/screen_capturer.dart';

CapturedData? capturedData = await screenCapturer.capture(
  mode: CaptureMode.region, // screen, window
  imagePath: '<path>',
  copyToClipboard: true,
);

请看这个插件的示例应用,以了解完整的例子。

平台差异

CaptureMode

Name Description Linux macOS Windows
region 在对象周围拖动光标以形成一个矩形。 ✔️ ✔️ ✔️
screen 捕获整个屏幕。 ✔️ ✔️ ✔️
window 选择要捕获的窗口。(linux 只捕获当前窗口) ✔️ ✔️

谁在用使用它?

贡献者

LiJianying
LiJianying

💻
Amit Mondal
Amit Mondal

💻
lightrabbit
lightrabbit

💻
liuyuxin
liuyuxin

💻
kalykun
kalykun

📖
Add your contributions

许可证

MIT