6

我尝试过 32x32、64x64,并尝试使用 Photoshop 将另一个应用程序的图标编辑到我的图标中以保持其大小,但它对我不起作用。看来我的图标是双倍大小的,我无法看到整个图标。

4

3 回答 3

8

You can append @2x after image's base filename to mark it as a high resolution image.

This was helpful for me: https://www.electronjs.org/docs/api/native-image#high-resolution-image

于 2020-03-30T22:05:18.540 回答
4

16x16 png 适用于 Macos 托盘图标。您还可以将@2x 32x32 png 用于高分辨率显示,例如16x16 'tray.png' 和32x32 'tray@2x.png'。

PS 您可以在iConvert Icons上轻松转换您的图标。

于 2018-11-29T09:51:50.267 回答
1
  const image = nativeImage.createFromPath(
    path.join(__dirname, "your-path/icon.png")
  );
  tray = new Tray(image.resize({ width: 16, height: 16 }));
于 2021-04-16T06:38:41.490 回答