screen

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package screen is a helper package that contains generic functions that allow for taking ScreenShots of the current display (if supported).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ActiveDisplays

func ActiveDisplays() (uint32, error)

ActiveDisplays returns the count of current active displays enabled on the device.

This function returns an error if any error occurs when retrieving the display count.

TODO(dij): Currently works only on Windows devices.

func Capture

func Capture(_ io.Writer) error

Capture attempts to take a PNG-encoded screenshot of all the active displays on the device into the supplied io.Writer.

This function will return an error getting the screen color info fails or encoding the image fails.

This function calculates the dimensions of all the active displays together and calls 'CaptureRange' underneath.

TODO(dij): Currently works only on Windows devices.

func CaptureRange

func CaptureRange(_, _, _, _ uint32, _ io.Writer) error

CaptureRange attempts to take a PNG-encoded screenshot of the current dimensions specified into the supplied io.Writer.

This function will return an error getting the screen color info fails or encoding the image fails.

TODO(dij): Currently works only on Windows devices.

func DisplayBounds

func DisplayBounds(_ uint32) (image.Rectangle, error)

DisplayBounds returns the bounds of the supplied display index.

This function will return the bounds of the first monitor if the index is out of bounds of the current display count.

TODO(dij): Currently works only on Windows devices.

Types

This section is empty.

Jump to

Keyboard shortcuts

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