舞台任务栏中的低质量图标。 JavaFX
Low quality icon in taskbar of a Stage. JavaFX
为什么舞台图标质量这么差?原始图像要好得多。
如何解决?
我使用此代码将图像设置为舞台图标:
stage.getIcons().add(new Image("/res/app_icon.png"));
截图:
原始图标:
更新
不幸的是,JavaFX 8 中图标选择器的实现并不总是从可用图标列表中为应用程序选择最佳图标大小。
参见:
这些问题(目前)计划在 Java 9.
中解决
关于这些问题的一些评论是:
Indeed, Glass currently supports assigning only one icon for a window, it won't allow one to assign a set of differently sized icons. This feature needs to be implemented in Glass.
--
I have noticed that when setting multiple icons, only the last one in the list returned by getIcons() is used. It doesn't matter if other icons, with better resolutions are in the list.
如果您提供不同尺寸的图标列表,请尝试将您希望最常使用的尺寸放在列表的最后(也许将列表从最小到最大排序或放置一个 48x48 图标,这是使用的尺寸在 Windows 7 的快速启动区域中,作为列表中的最后一个或唯一的元素)。不幸的是,我无法访问 Windows 机器来测试该平台的最佳图标大小。
图标指南(但请注意上述更新中的信息):
- 提供一组不同大小的高质量图标到列表中
从返回
stage.getIcons()
.
- 运行时将选择最合适的尺寸。
- 使用标准图标
大多数操作系统无需进一步缩放即可使用的大小(例如
实例项目大小是 2 的幂或 48x48)。
- 使用高质量的源图像(你问题中的原始源图像对我来说有点模糊)。
- 对于非常小的图标,有时将较大的图标纯缩放到较小的尺寸并不是最好的。有时,图标设计者最好清理并删除小图标中的复杂细节,这在较大的图标中可能没问题 - 请参阅 discussion on icon size on Pushing Pixels 以帮助理解原因。
- 有关 this icon handbook 中的操作系统使用的图标大小的信息。
stage.getIcons().addAll(
new Image("/res/app_icon64x64.png"),
new Image("/res/app_icon32x32.png"),
new Image("/res/app_icon16x16.png")
);
各种尺寸的高质量图标的重要来源是 http://www.iconarchive.com, for example this refresh icon。
为什么舞台图标质量这么差?原始图像要好得多。 如何解决?
我使用此代码将图像设置为舞台图标:
stage.getIcons().add(new Image("/res/app_icon.png"));
截图:
原始图标:
更新
不幸的是,JavaFX 8 中图标选择器的实现并不总是从可用图标列表中为应用程序选择最佳图标大小。
参见:
这些问题(目前)计划在 Java 9.
中解决关于这些问题的一些评论是:
Indeed, Glass currently supports assigning only one icon for a window, it won't allow one to assign a set of differently sized icons. This feature needs to be implemented in Glass.
--
I have noticed that when setting multiple icons, only the last one in the list returned by getIcons() is used. It doesn't matter if other icons, with better resolutions are in the list.
如果您提供不同尺寸的图标列表,请尝试将您希望最常使用的尺寸放在列表的最后(也许将列表从最小到最大排序或放置一个 48x48 图标,这是使用的尺寸在 Windows 7 的快速启动区域中,作为列表中的最后一个或唯一的元素)。不幸的是,我无法访问 Windows 机器来测试该平台的最佳图标大小。
图标指南(但请注意上述更新中的信息):
- 提供一组不同大小的高质量图标到列表中
从返回
stage.getIcons()
. - 运行时将选择最合适的尺寸。
- 使用标准图标 大多数操作系统无需进一步缩放即可使用的大小(例如 实例项目大小是 2 的幂或 48x48)。
- 使用高质量的源图像(你问题中的原始源图像对我来说有点模糊)。
- 对于非常小的图标,有时将较大的图标纯缩放到较小的尺寸并不是最好的。有时,图标设计者最好清理并删除小图标中的复杂细节,这在较大的图标中可能没问题 - 请参阅 discussion on icon size on Pushing Pixels 以帮助理解原因。
- 有关 this icon handbook 中的操作系统使用的图标大小的信息。
stage.getIcons().addAll(
new Image("/res/app_icon64x64.png"),
new Image("/res/app_icon32x32.png"),
new Image("/res/app_icon16x16.png")
);
各种尺寸的高质量图标的重要来源是 http://www.iconarchive.com, for example this refresh icon。