winss

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2023 License: MIT Imports: 7 Imported by: 0

README

winss

License MIT Go Report Card Visitors

  • Go library for capturing screenshot on windows

Install

go get github.com/songlim327/winss

Example

    package main

    import (
        "log"

        "github.com/songlim327/winss"
    )

    func main() {
        handler, err := winss.FindWindow("winss example.txt - Notepad")
        if err != nil {
            log.Fatal(err)
        }

        // Pass the handler as argument
        img := winss.Screenshot(handler)

        // Screenshot() will return *image.RGBA, pass it together with filename as arguments to SaveImage()
        err := winss.SaveImage(img, "./winss.png")
        return err
    }

Sample Result

screenshot

License

MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindWindow

func FindWindow(name string) (w32.HWND, error)

FindWindow returns the window handler

func SaveImage added in v1.0.2

func SaveImage(img image.Image, filename string) error

SaveImage saves the image to the specified file name

func Screenshot

func Screenshot(hWnd w32.HWND) *image.RGBA

Screenshot will take a screenshot of the given windows handler

Types

This section is empty.

Jump to

Keyboard shortcuts

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