screen

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

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。

Documentation

Overview

Package screen lists displays and captures screenshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capture

func Capture(displayID uint32) ([]byte, error)

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.

Types

type Display

type Display = sys.Display

Display bounds are logical points; the origin is the primary display's top left.

func Displays

func Displays() ([]Display, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL