Discover Packages
github.com/dyike/keel
native
screen
package
Version:
v0.1.1
Opens a new window with list of versions in this module.
Published: Oct 5, 2026
License: AGPL-3.0
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
native/screen
列出显示器,截取整屏 PNG。
依赖 :native(错误值)、native/internal/sys。
单独使用 :可以,不需要窗口。截图需要屏幕录制权限,自己不弹框,可以配合 native/permission 申请。
import "github.com/dyike/keel/native/screen"
displays, err := screen.Displays()
png, err := screen.Capture(displays[0].ID) // 最多阻塞 10 秒,不能在主线程调用
详见 原生能力 · screen 。
Expand ▾
Collapse ▴
Documentation
¶
Package screen lists displays and captures screenshots.
Capture returns a PNG of the display at native resolution. It needs the
ScreenRecording permission, never prompts, and times out after 10 seconds;
call it off the UI goroutine.
Display bounds are logical points; the origin is the primary display's top left.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.