根据文档(https://developer.garmin.com/connect-iq/programmers-guide/resource-compiler/),资源编译器支持GIF作为位图。然而,当我显示一个GIF文件时,我只会得到一个静止的图片,而GIF不会移动。
我一直在测试的GIF是这样的:http://bestanimations.com/Animals/Mammals/Cats/cats/cute-kitty-animated-gif-2.gif和我已经将gif保存在可绘图文件夹中(我使用了用于Eclipse的ConnectIQ插件)。
我试图将位图包含在布局资源中,如下所示:
<layout id="MainLayout">
<bitmap id="MotivatorCat" x="center" y="center" filename="../drawables/motivatorcat.gif"/>
</layout>我试图把它列入可绘制资源中,作为:
<drawables>
<bitmap id="MotivatorCat" filename="motivatorcat.gif" />
</drawables>然后,通过以下方式将其加载到初始化()中:
catgif = Ui.loadResource(Rez.Drawables.MotivatorCat);并在onUpdate()中绘制它:
dc.drawBitmap(50, 50, catgif);但什么都不管用。
我做错了什么?
发布于 2016-11-29 05:06:02
Connect IQ目前不支持渲染动画GIF图像(截至SDK2.1.x)。
https://stackoverflow.com/questions/40681243
复制相似问题