forked from kbinani/screenshot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreenshot_linux.go
More file actions
25 lines (20 loc) · 772 Bytes
/
screenshot_linux.go
File metadata and controls
25 lines (20 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package screenshot
import (
"image"
"github.com/kbinani/screenshot/internal/xwindow"
)
// Capture returns screen capture of specified desktop region.
// x and y represent distance from the upper-left corner of main display.
// Y-axis is downward direction. This means coordinates system is similar to Windows OS.
func Capture(x, y, width, height int) (*image.RGBA, error) {
return xwindow.Capture(x, y, width, height)
}
// NumActiveDisplays returns the number of active displays.
func NumActiveDisplays() int {
return xwindow.NumActiveDisplays()
}
// GetDisplayBounds returns the bounds of displayIndex'th display.
// The main display is displayIndex = 0.
func GetDisplayBounds(displayIndex int) image.Rectangle {
return xwindow.GetDisplayBounds(displayIndex)
}