1.0.1 • Published 4 years ago

tinechat-screenshot v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

tinechat-screenshot

region screenshot for electron.

usage

npm install tinechat-screenshot

in mainProcess.js

import { initMain } from 'tinechat-screenshot';

app.on('ready', () => {
  const win = new BrowserWindow();
  initMain(win.webContents);
})

in renderProcess.js

import { screenshot } from 'tinechat-screenshot';
screenshot().then(({ base64 } => {
  console.log(base64);
});

notice

when use in Windows. add the snippet in package.json

...
 "build": {
    ...
    "asarUnpack": [
      "*.exe"
    ],
    ...
 }
...