Need help with JavaScript-screenshot?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

usecodelee
129 Stars 56 Forks MIT License 71 Commits 1 Opened issues

Description

JavaScript implementation of a screenshot with html2canvas.js and canvas2image.js(js实现屏幕截图)

Services available

!
?

Need anything else?

Contributors list

# 242,302
C#
des
Vue.js
iOS
61 commits

JavaScript-screenshot

star this repofork this repo npm languages node MIT Licence

中文

Introduction

JavaScript implementation screenshot,There are two libraries used:

Html2Canvas.js
Canvas2Image.js

I mainly made two demos and one NPM package:

  1. Simple Version
  2. Webpack+Vue+Element Version
  3. js-screenshot-for-npm

Simple Version Of Use

Open

index.html
directly in your browser.

Webpack+Vue+Element Version Of Use

# install dependencies
npm install

serve with hot reload at localhost:8080

npm run dev

build for production with minification

npm run build

build for production and view the bundle analyzer report

npm run build --report

Example

The original html is like this:

This is the element node:

This is after converting to canvas:

This is the element node:

This is after converting to img:

This is the element node:

This is the final result:

js-screenshot-for-npm

npm install --save js_screen_shots

For details, see the document README.md.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.