Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zxlie/FullPageCaptureWithVideo
网页截图,支持Video截图
https://github.com/zxlie/FullPageCaptureWithVideo
capture-with-video html2image page2image pagecapture screen-capture
Last synced: 3 months ago
JSON representation
网页截图,支持Video截图
- Host: GitHub
- URL: https://github.com/zxlie/FullPageCaptureWithVideo
- Owner: zxlie
- Created: 2018-10-24T14:20:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-31T09:48:51.000Z (about 6 years ago)
- Last Synced: 2024-06-21T23:36:48.180Z (4 months ago)
- Topics: capture-with-video, html2image, page2image, pagecapture, screen-capture
- Language: JavaScript
- Size: 4.88 KB
- Stars: 13
- Watchers: 1
- Forks: 8
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FullPageCaptureWithVideo
JS网页截图,支持Video截图
## 使用方法
```htmlFullPageCaptureWithVideo.capture(YourDomElement, function (imageDataURL) {
// TODO:处理图片
});```
## 示例1:全网页截图
```javascript
FullPageCaptureWithVideo.capture(null, function (data) {
// 新窗口打开图片
window.open().document.write("");
// 当然,你也可以直接上传保存图片
// Upload(data)
});
```## 示例2:截取某个节点/区域
```javascript
FullPageCaptureWithVideo.capture({
dom: document.getElementById('video_chat_container')
}, function (data) {
// 新窗口打开图片
window.open().document.write("");
// 当然,你也可以直接上传保存图片
// Upload(data)
});
```## 示例3:还可以自行指定html2canvas.min.js的地址
```javascript
FullPageCaptureWithVideo.capture({
// 默认: 'https://html2canvas.hertzen.com/dist/html2canvas.min.js'
h2cUrl: 'your html2canvas.min.js absolute url here...'
}, function (data) {
// 新窗口打开图片
window.open().document.write("");
// 当然,你也可以直接上传保存图片
// Upload(data)
});
```## 示例4:加个水印也是OK的
```javascript
// 设置水印
FullPageCaptureWithVideo.capture({
waterMark: {
text:'抓取于:' + new Date().toLocaleString(),
font: "20px Arial",
color: '#f00',
position: {
x: 20,
y: 20
}
}
}, function (data) {
// 新窗口打开图片
window.open().document.write("");
// 当然,你也可以直接上传保存图片
// Upload(data)
});
```