[英]Does jMonkey support 96x96 .ico assets?
A Java application uses jMonkey for rendering purposes. Java 应用程序使用 jMonkey 进行渲染。 This application is loading a custom icon when in view mode.
此应用程序在查看模式下加载自定义图标。 The icon in use is 32x32 and is loaded like this, as it is a cursor:
正在使用的图标是 32x32 并像这样加载,因为它是 cursor:
JmeCursor cursor = (JmeCursor) Services.getAssetManager().loadAsset( "/path/someIcon.ico" );
Where Services
is just some irrelevant class to retrieve the jMonkey AssetManager
. Services
只是一些无关紧要的 class 来检索 jMonkey AssetManager
。
I read about typical .ico
sizes and one of them appears to be 96x96.我阅读了典型的
.ico
大小,其中一个似乎是 96x96。 However when attempting to load a 96x96 .ico
file as an asset using the code snippet above, I ran into jMonkey not being able to load the asset, even though according to debugger output the resource was indeed found.但是,当尝试使用上面的代码片段将 96x96
.ico
文件作为资产加载时,我遇到了 jMonkey 无法加载资产,即使根据调试器 output 确实找到了资源。
When checking with the debugger, I can follow the loading process into the DesktopAssetManager#loadAsset
until it dives deeper into classes I cannot see and then a Throwable
without useful stack trace, message or other info shows up.使用调试器检查时,我可以将加载过程跟踪到
DesktopAssetManager#loadAsset
,直到它深入到我看不到的类中,然后出现一个没有有用堆栈跟踪、消息或其他信息的Throwable
。 When I switch to any other 32x32 .ico
file all works fine again.当我切换到任何其他 32x32
.ico
文件时,一切正常。
Right to the chase:追逐权:
.ico
files as assets via loadAsset
? loadAsset
加载 96x96 .ico
文件作为资产? Yes.是的。 I created an.ico with the following imagemagick command (and added a 96x96 option):
我使用以下 imagemagick 命令创建了 an.ico(并添加了 96x96 选项):
convert image.png -bordercolor white -border 0 \
\( -clone 0 -resize 16x16 \) \
\( -clone 0 -resize 32x32 \) \
\( -clone 0 -resize 48x48 \) \
\( -clone 0 -resize 64x64 \) \
\( -clone 0 -resize 96x96 \) \
-delete 0 -alpha off -colors 256 favicon.ico
Source: https://unix.stackexchange.com/questions/89275/how-to-create-ico-file-with-more-than-one-image/89276#89276来源: https://unix.stackexchange.com/questions/89275/how-to-create-ico-file-with-more-than-one-image/89276#89276
ImageMagick: https://imagemagick.org/ ImageMagick: https://imagemagick.org/
It loaded without problems using assetManager.loadAsset()使用assetManager.loadAsset() 加载没有问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.