Giter VIP home page Giter VIP logo

captis's Introduction

Captis - A library for capturing the screen on Linux, MacOS and Windows

It's a fairly simple library that performs good enough, the OS level APIs that were used are inspired by python-mss.

Specification

  • Windows implementation uses the Windows GDI API.
  • Linux X11 implementation uses the XRandR extension to get information about the displays, for capturing the XShm extension is used if available, otherwise we fallback to the standard protocol.
  • MacOS implementation uses the Core Graphics Framework.

Usage

To run this code you also need to add image crate to your project and enable the jpeg feature, otherwise you won't be able to save the file as JPEG.

The same goes for any other format as well, if you wanna treat the image as PNG you must enable png feature. Check their documentation to see which formats are available.

use captis::{init_capturer, Capturer};

let capturer = init_capturer().expect("Couldn't Initialize Capturer");

let image = capturer.capture(0).expect("Couldn't Capture Screen");

image.save("test.jpeg").expect("Couldn't Save Image");

Supported Platforms

  • Windows
  • Linux (X11)
  • MacOS

captis's People

Contributors

kasparpalgi avatar selyatin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  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.