GithubHelp home page GithubHelp logo

chenkie / electron-screencapture Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kasprownik/electron-screencapture

0.0 3.0 0.0 3 KB

Library that allows to take a picture or a video from any fragment of the display

JavaScript 100.00%

electron-screencapture's Introduction

#electron-screencapture

Library that allows to take a picture or a video from any fragment of the display.

API

takeScreenshot({x, y, width, height, sourceId})

Takes static screenshot and returns promise with the result.

  • x, y, width, height - these params define the rectangle of the frame
  • sourceId - id of the display, primary display by default

####Example

import {takeScreenshot} from "electron-screencapture";

takeScreenshot({x: 0, y: 0, width: 800, height: 600}).then(result => {
    console.log(result);
});

captureVideo({x, y, width, height, sourceId})

Starts recording and returns promise with the object with the control api.

  • x, y, width, height - these params define the rectangle of the frame
  • sourceId - id of the display, primary display by default

####Control API object

  • stop() - stops recording and returns promise with the video
  • pause() - pauses recording
  • resume() - resumes recording if paused

####Example

import {captureVideo} from "electron-screencapture";

captureVideo({x: 0, y: 0, width: 800, height: 600}).then(recorder => {
    setTimeout(() => recorder.stop().then(result => {
        console.log(result);
    }), 1000);
});

electron-screencapture's People

Contributors

kasprownik avatar

Watchers

 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.