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: 0

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