screenshot

package module
v0.0.0-...-3722a64 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: MIT Imports: 4 Imported by: 3 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Screenshot

Simple cross-platform pure Go screen shot library. (tested on linux&windows&osx)

Changes:

  • Changed: linux and freebsd source code is one file now
  • Changed: linux (and freebsd) code refactored
  • Changed: Connection to X in linux is separated from screenshoting (Now no memory leakage while screenshoting in a loop)

Basic Usage

Import the package

import (
    "github.com/rostislaved/screenshot"
)
func main() {

	screenshoter := screenshot.New()

	img, err := screenshot.CaptureScreen()
	if err != nil {
		log.Fatal(err)
	}
}

Dependencies

Examples

Look at examples/ folder.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Screenshoter

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

func New

func New() *Screenshoter

func (*Screenshoter) CaptureRectangle

func (s *Screenshoter) CaptureRectangle(rectangle image.Rectangle) (*image.RGBA, error)

func (*Screenshoter) CaptureScreen

func (s *Screenshoter) CaptureScreen() (img *image.RGBA, err error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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