GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — JavaScript-screenshot/js-screenshot-for-npm at master · mengmengj/JavaScript-screenshot

Expand file tree

/

js-screenshot-for-npm

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
 
 
/

js-screenshot-for-npm

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
node_modules
node_modules
 
 
README.md
README.md
 
 
js_screen_shot.js
js_screen_shot.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

README.md

Outline

js_screen_shots

一个基于 JavaScript 的 DOM 截图工具。

star this repofork this repo npm MIT Licence

如何使用

1.安装

# 使用npm安装
npm install --save js_screen_shots

2.导入

import all from '../node_modules/js_screen_shots'
console.log(all);
// {html2canvas: ƒ, Canvas2Image: {…}}
// Canvas2Image: {saveAsImage: ƒ, saveAsPNG: ƒ, saveAsJPEG: ƒ, saveAsGIF: ƒ, saveAsBMP: ƒ, …}
// html2canvas: ƒ html2canvas(element, conf)

3.使用

可以看见all对象里面有两个方法:html2canvas和Canvas2Image。
html2canvas的作用是把html标签转化为canvas元素。
Canvas2Image的作用是把canvas元素转化为img元素。

参考文档

html2canvas文档
Canvas2Image文档

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.