Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kejiacheng/kscreenshot
web截图工具 前端截图 screenshot
https://github.com/kejiacheng/kscreenshot
Last synced: 4 months ago
JSON representation
web截图工具 前端截图 screenshot
- Host: GitHub
- URL: https://github.com/kejiacheng/kscreenshot
- Owner: kejiacheng
- Created: 2018-05-24T01:52:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-04-29T02:37:08.000Z (almost 5 years ago)
- Last Synced: 2024-05-12T08:22:11.658Z (9 months ago)
- Language: JavaScript
- Homepage:
- Size: 4.69 MB
- Stars: 316
- Watchers: 14
- Forks: 86
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
kscreenshot
===========# 由于该插件还存在问题,不推荐在项目中使用该插件。


npm:
```sh
npm install kscreenshot --save
```### 功能
该截图工具带有下载,复制功能,并可用工具栏对截图进行简单绘制。
工具栏功能从左到右依次为:颜色,文字,椭圆,矩形,线条,箭头,后退,完成。
### 使用
```js
import kscreenshot from 'kscreenshot'//65指键盘中的A
new kscreenshot(
{
key: 65
}
)
```
当按下shift + A将会触发截图功能#### 参数
参数
说明
类型
默认值
key
截图触发按键(例:65时则同时按下shit + A则触发截图)
number
65
toolShow
工具栏各个工具显示(具体见下面toolshow配置)
object
默认每个工具都显示
copyPath
参数为base64格式的图片(该功能不建议使用,最好是结合nw electron等工具实现复制功能。js目前暂未找到能兼容各客户端的方法,因此最好return null)
Function
noob
needDownload
是否下载截图后的图片
bool
false
endCB
成功结束截图后的回调函数
Function
noob
cancelCB
撤销截图后的回调函数(关闭按钮,esc,鼠标右键)
Function
noob
immediately
是否立即开启截图
bool
false
#### toolShow配置
参数
说明
类型
默认值
complete
控制确认按键显示
bool
true
quit
控制退出按键显示
bool
true
back
控制后退按键显示
bool
true
arrow
控制箭头按键显示
bool
true
drawLine
控制线条按键显示(可以输入数字,初始化线条粗细,[1-10])
bool
true
rect
控制矩形按键显示
bool
true
ellipse
控制椭圆按键显示
bool
true
text
控制文字按键显示
bool
true
color
控制颜色版按键显示
bool
true
#### 方法
startScreenShot()
开启截图
endScreenShot()
结束截图
### 结合NW,Electron等前端桌面开发库可实现整个显示屏截图
#### 实现demo图
