2022-04-14 09:22:59 +08:00
|
|
|
|
# finclip-electron-demo
|
|
|
|
|
|
2022-04-14 12:09:01 +08:00
|
|
|
|
## 📦 安装第三方依赖
|
2022-04-14 09:22:59 +08:00
|
|
|
|
|
2022-04-14 12:09:01 +08:00
|
|
|
|
[下载finclip二进制包](https://github.com/finogeeks/finclip-win32-demo/releases)到`vendor`的对应目录下,如`vendor/win/x64`
|
2022-04-14 09:22:59 +08:00
|
|
|
|
|
|
|
|
|
## 快速开始
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
npm i
|
|
|
|
|
npm run start
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 调用finclip api
|
|
|
|
|
|
|
|
|
|
1. 引入finclip依赖包
|
|
|
|
|
|
|
|
|
|
注意,只能在electron的主进程使用
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
const finclip = require('finclip');
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-15 10:56:50 +08:00
|
|
|
|
2. 设置启动参数
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
finclip.setDomain('xxx');
|
|
|
|
|
finclip.setAppkey('xxx');
|
|
|
|
|
finclip.setAppid('xxx');
|
|
|
|
|
finclip.setSecret('xxx');
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
3. 打开finclip窗口
|
2022-04-14 09:22:59 +08:00
|
|
|
|
|
|
|
|
|
finclipPath为finclip.exe所在位置,需转换成绝对路径
|
|
|
|
|
```
|
|
|
|
|
finclip.start({
|
|
|
|
|
handle: 0,
|
|
|
|
|
finclipPath,
|
|
|
|
|
});
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-15 10:56:50 +08:00
|
|
|
|
4. 关闭finclip窗口
|
2022-04-14 09:22:59 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
finclip.close();
|
|
|
|
|
```
|
|
|
|
|
|
2022-04-15 10:56:50 +08:00
|
|
|
|
5. 设置finclip窗口的位置和大小
|
2022-04-14 09:22:59 +08:00
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
finclip.setPosition({ width: 800, height: 800, left: 0, top: 0 });
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## 修改finclip依赖包
|
|
|
|
|
|
|
|
|
|
如果默认的finclip包无法满足需求,可以在此项目的`src/npm`下修改并编译,需要先配置C++环境
|