简体   繁体   English

在WP7应用中使用a.GIF animation作为启动画面

[英]Using a .GIF animation as the splash screen in WP7 application

I have an animated.GIF image that I created with http://ajaxload.info/ and some editing.我有一个使用http://ajaxload.info/和一些编辑创建的动画 .GIF 图像。 I would like to set the resulting icon as the splash screen in my app, which can take a few seconds to load.我想在我的应用程序中将生成的图标设置为启动画面,这可能需要几秒钟才能加载。

I don't think that I can set the icon as the SplashScreenImage.我不认为我可以将图标设置为 SplashScreenImage。 jpg (GIF.= JPG) and I'm not sure how to view the image as a MediaElement either. jpg (GIF.= JPG),我也不确定如何将图像视为 MediaElement。 (I would show the image while the main Canvas was loading.) (我会在加载主 Canvas 时显示图像。)

DOes anyone have any links/code on how to set both the SplashScreenImage to use the.GIF AND how to use the.GIF in a XAML page (from code-behind)?有没有人有任何关于如何设置 SplashScreenImage 以使用.GIF 以及如何在XAML页面中使用.GIF 的链接/代码(来自代码隐藏)?

Silverlight doesn't support GIF files. Silverlight 不支持 GIF 文件。 There are a couple of things you could do.你可以做几件事。 Firstly, you could create the same animation in Blend (as a Storyboard).首先,您可以在 Blend 中创建相同的 animation(作为故事板)。 Or, you could display a WebBrowser control which does render GIF files.或者,您可以显示一个呈现 GIF 文件的 WebBrowser 控件。

As you mentioned, you can't change the SplashScreen image.正如您所提到的,您无法更改 SplashScreen 图像。 It has to be a jpeg and there's no getting around this.它必须是一个jpeg并且没有解决这个问题。 What you could do, however, is have your app load your page with your animation in a PopUp.但是,您可以做的是让您的应用程序在弹出窗口中使用 animation 加载您的页面。 On a separate thread, you can load your main page and then use a dispatcher to push this on to the UI thread.在单独的线程上,您可以加载主页面,然后使用调度程序将其推送到 UI 线程。 There is an example of how to do this in this blog post . 此博客文章中有一个如何执行此操作的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM