Agaonm / screenshot

Go library to capture desktop to image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

Go library to capture desktop to image

License:MIT License


Languages

Language:Go 93.0%Language:Shell 7.0%