GithubHelp home page GithubHelp logo

rpdg / go-scrap Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cretz/go-scrap

0.0 0.0 0.0 19 KB

Go library to capture screen pixels for screenshots or screen recording

License: MIT License

C 4.46% Go 76.00% Rust 19.55%

go-scrap's Introduction

go-scrap GoDoc

go-scrap is a Go wrapper around the Rust scrap library. It supports reasonably fast capturing of raw screen pixels. The library dependency is only at compile time and statically compiled into the binary. It works on Windows, Linux, and macOS.

Building

Obtain the library, e.g. use go get with -d to not install yet:

go get -d github.com/cretz/go-scrap

Now, the Rust subproject scrap-sys must be compiled which is glue between the Go library and the Rust library. With Rust installed, this can is done by running the following in the scrap-sys/ subdirectory:

cargo build --release

Note: On Windows this must use the same gcc that Cgo would. Go does not support MSVC-compiled libraries yet. The easiest way to ensure this is with rustup by running rustup default stable-x86_64-pc-windows-gnu before building.

Note: On Linux this needs the X11 XCB libraries with the Shm and RandR extensions. On Ubuntu (18.04+ since RandR must be >= 1.12) they are packages named libx11-xcb-dev, libxcb-shm0-dev, and libxcb-randr0-dev respectively.

Now that the dependency is built, the library can be built. For example, take a screenshot:

go run ./example/screenshot

See the Godoc for more documentation and examples.

go-scrap's People

Contributors

cretz avatar rdnt avatar notedit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.