Animated GIF in Splashscreen

坚强是说给别人听的谎言 提交于 2019-12-11 19:25:50

问题


I have a JAR file generated by an ANT script with the following code in it:

<manifest>
   <attribute name="Main-Class" value="org.epistasis.exstracs.Main"/>
   <attribute name="Class-Path" value="."/>
   <attribute name="SplashScreen-Image" value="logo_anim.gif"/>
</manifest>
<!--Some code-->
<zipfileset dir="." includes="logo.png"/>
<zipfileset dir="." includes="logo_anim.gif"/>
<zipfileset dir="." includes="icon.png"/>

When I run the JAR file, no splash screen is generated. I verified that the GIF was in the file by opening it with my favorite archive manager. I also loaded the GIF from the code and successfully displayed it. However, it won't load as a splashscreen. (no splashscreen displayed, SplashScreen.getSplashScreen() returns null)

If I replace

<attribute name="SplashScreen-Image" value="logo_anim.gif"/>

With

<attribute name="SplashScreen-Image" value="logo.png"/>

OR

<attribute name="SplashScreen-Image" value="icon.png"/>

The splashscreen is displayed with the specified image.

I'm not sure if this matters, but the GIF is significantly larger than the PNG files. (~2MB for logo_anim.gif vs 40KB for logo.png)

来源:https://stackoverflow.com/questions/18601225/animated-gif-in-splashscreen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!