无法获取 GIF 动画
我无法在 CLabel 中获取动画 GIF。我也尝试过标签。
final CLabel lblSpinner = new CLabel(this, SWT.NONE);
lblSpinner.setImage(SWTResourceManager.getImage(Installation_4.class, "/resources/spinner_anim_16.gif"));
怎么了?仅显示第一个 GIF。在 RCP 中,我必须以编程方式制作动画,但在 RAP 中,我认为这必须是浏览器的工作。
I can't get an animated GIF animated within a CLabel. I also tried Label.
final CLabel lblSpinner = new CLabel(this, SWT.NONE);
lblSpinner.setImage(SWTResourceManager.getImage(Installation_4.class, "/resources/spinner_anim_16.gif"));
What's wrong? Only the first GIF is displayed. In RCP I have to animate programatically but in RAP this must be a job for the browser I thought.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以下代码片段适用于 RAP,同时使用
Label
和CLabel
:如果这不适用于您的图像,则问题出在图像本身。否则,您的
SWTResourceManager.getImage()
方法一定做错了什么。请注意,如果您从ImageData
构造Image
,它们将仅包含动画 gif 的单个帧。The following snippet works with RAP, with both
Label
andCLabel
:If this doesn't work with your image, then the problem is in the image image itself. Otherwise, you must be doing something wrong in your
SWTResourceManager.getImage()
method. Please note that if you construct anImage
fromImageData
, these will only contain a single frame of the animated gif.