/screenshot

Go library to capture desktop to image

Primary LanguageGoMIT LicenseMIT

screenshot

Go Report Card

  • Go library to capture desktop screen from Kbinani/screenshot

  • Added Window Capture for Specific Application on Windows

example to Capture Single Application

  • sample program main.go

     package main
    
     import (
     	"github.com/kbinani/screenshot"
     	"image/png"
     	"os"
     	"fmt"
     )
    
     func main() {
     	window := gocv.NewWindow("Capture")
    
     	for {
     		winName := "Spotify Premium"
     		u16fname, err := syscall.UTF16FromString(winName)
    
     		img, err := screenshot.CaptureApp2(&u16fname[0])
     		if err != nil {
     			panic(err)
     		}
    
     		imgMat, err := gocv.ImageToMatRGBA(img)
     		if err != nil {
     			panic(err)
     		}
    
     		window.IMShow(imgMat)
    
     		window.WaitKey(1)
     	}
     }

license

MIT Licence

author

kbinani