mirror of
https://github.com/XZB-1248/Spark
synced 2025-09-26 20:21:11 +08:00
24 lines
351 B
Go
24 lines
351 B
Go
//go:build !windows
|
|
// +build !windows
|
|
|
|
package desktop
|
|
|
|
import (
|
|
"github.com/kbinani/screenshot"
|
|
"image"
|
|
)
|
|
|
|
type Screen struct {
|
|
rect image.Rectangle
|
|
}
|
|
|
|
func (s *Screen) Init(_ uint, rect image.Rectangle) {
|
|
s.rect = rect
|
|
}
|
|
|
|
func (s *Screen) Capture() (*image.RGBA, error) {
|
|
return screenshot.CaptureRect(s.rect)
|
|
}
|
|
|
|
func (s *Screen) Release() {}
|