Simple cross-platform pure Go screen shot library. (tested on linux&windows&osx)
- 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)
Import the package
import (
"github.com/rostislaved/screenshot"
)
func main() {
screenshoter := screenshot.New()
img, err := screenshot.CaptureScreen()
if err != nil {
log.Fatal(err)
}
}
- Windows - None
- Linux/FreeBSD - https://github.com/BurntSushi/xgb
- OSX - cgo (CoreGraphics,CoreFoundation, that should not be a problem)
Look at examples/
folder.