bug_x

导航

< 2025年2月 >
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 1
2 3 4 5 6 7 8
统计
 

1、shell.openItem(fullPath)

var fullpath = path.join(processPath)+Math.random()+".png";

shell.showItemInFolder(fullPath)  //如果fullPath 是一个文件夹则打开,如果是一个文件,则打开其所在文件夹

https://electron.atom.io/docs/api/shell/

2\截图:

https://github.com/electron/electron/issues/8587

1
2
3
4
5
6
7
8
9
10
11
12
function takePicture(imagePath){
  var imagePath = imgFile || path.join(processPath)+Math.random()+".png";
  remote.getCurrentWebContents().capturePage({
    x: 0,
    y: 40,
    width: 0,    //保持原样,必须写
    height: 0    //保持原样。必须写 这4个参数
  },function(img){
    remote.require('fs').writeFile(imagePaht,img.toPng());
    shell.showItemInFolder(imagePath);
  });
}

  

posted on   bug_x  阅读(706)  评论(0编辑  收藏  举报
 
点击右上角即可分享
微信分享提示