display

package
v0.0.0-...-dc2b14c Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ActiveDisplayNums = 0
)
View Source
var (
	NotFound = errors.New("active display not found")
)

Functions

This section is empty.

Types

type Img

type Img struct {
	// contains filtered or unexported fields
}

func CapAll

func CapAll() (*Img, error)

CapAll union all display

func CapByDisPlay

func CapByDisPlay(displayIndex int) (*Img, error)

CapByDisPlay captures whole region of display Index'th display.

func CapMain

func CapMain() (*Img, error)

CapMain captures whole region of first display.

func Capture

func Capture(x, y, width, height int) (*Img, error)

Capture custom crop

func (Img) Encode

func (i Img) Encode() (*bytes.Buffer, error)

Encode Img to bytes with png format

func (*Img) Resize

func (i *Img) Resize() *Img

func (Img) Save

func (i Img) Save(path string) error

Save saves the image to file with the specified filename. The format is determined from the filename extension: "jpg" (or "jpeg"), "png", "gif", "tif" (or "tiff") and "bmp" are supported.

Examples:

// Save the image as PNG.
err := Img.Save("out.png")

// Save the image as JPEG.
err := Img.Save("out.jpg")

Jump to

Keyboard shortcuts

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