簡體   English   中英

如何使用XAML從UWP中的URL顯示GIF圖像?

[英]How to display GIF Image from URL in UWP using XAML?

我想從我的應用程序中的以下URL顯示此GIF:

點擊這里

我無法通過常規過程來實現這一點,它只是顯示圖像而沒有任何動畫。

我不知道什么對您不起作用,但是我很快做了一個演示項目,GIF很好顯示。

MainPage.xaml:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Image Height="200" Width="200" Source="{x:Bind ImageSource, Mode=OneWay}"/>
</Grid>

MainPage.xaml.cs

public sealed partial class MainPage : Page
    {
        private string ImageSource { get; set; }
        public MainPage()
        {
            this.InitializeComponent();
            ImageSource = @"http://api.wunderground.com/api/9270a990901ad2ce/animatedradar/animatedsatellite/image.gif?num=5&delay=50&rad.maxlat=47.709&rad.maxlon=-69.263&rad.minlat=31.596&rad.minlon=-97.388&rad.width=640&rad.height=480&rad.rainsnow=1&rad.reproj.automerc=1&rad.num=5&sat.maxlat=47.709&sat.maxlon=-69.263&sat.minlat=31.596&sat.minlon=-97.388&sat.width=640&sat.height=480&sat.key=sat_ir4_bottom&sat.gtt=107&sat.proj=me&sat.timelabel=0&sat.num=5";
        }
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM