C# 具有远程路径的WPF映像

C# 具有远程路径的WPF映像,c#,wpf,C#,Wpf,我正在尝试将图像加载到Silverlight项目中,我有以下XAML: <UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schema

我正在尝试将图像加载到Silverlight项目中,我有以下XAML:

<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400" xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk">

    <Grid x:Name="LayoutRoot" Background="White">
        <Image Height="150" Width="200" Source="http://wsf.cdyne.com/WeatherWS/Images/rain.gif" />
    </Grid>
</UserControl>

Silverlight中的图像控件仅支持PNG和JPEG,不支持GIF


那么我应该使用什么呢?@Spencer尝试实现一个valueconverter来将GIF内容转换为支持的格式?最简单的方法是使用不同的文件格式。但是如果你坚持使用GIF,一位silverlight项目经理写到他如何使用外部框架在silverlight中显示动画GIF(靠近底部)。但我个人还没有尝试过: