前提

  1. 确定其他环境可以获取到图标
  2. win7报错的路径真实存在

解决方法

const { nativeImage } = require('electron')
const icon = path.join(__dirname, '路径') // __dirname为主进程执行的同级目录
let tray = new Tray(nativeImage.createFromPath(icon))

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2022-12-23
  • 2022-12-23
  • 2021-09-19
  • 2021-05-25
猜你喜欢
  • 2021-11-24
  • 2021-09-23
  • 2022-12-23
  • 2022-01-06
  • 2022-12-23
  • 2021-08-03
  • 2021-10-02
相关资源
相似解决方案