C# 图像在Win8/Win10中渲染,但不在Win7中渲染

C# 图像在Win8/Win10中渲染,但不在Win7中渲染,c#,wpf,xaml,windows-7,C#,Wpf,Xaml,Windows 7,我的文档中有以下XAML: <Border HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="100" Width="100" BorderBrush="Red" BorderThickness="2"> <Image x:Name="image" Source="http://myinternalserver/mywebservice/ge

我的文档中有以下XAML:

<Border HorizontalAlignment="Right" VerticalAlignment="Bottom"
        Height="100" Width="100"
        BorderBrush="Red" BorderThickness="2">
    <Image x:Name="image"
           Source="http://myinternalserver/mywebservice/getimage.aspx?id=1234&amp;ContentType=Image" />
</Border>

在Win10和Win8中,图像显示得很好,但在Win7中,我得到的只是一个带有透明背景的红色边框,里面没有图像。当我使用静态URL时,就像谷歌徽标一样,它会在所有版本中呈现


有人知道如何在Windows 7中进行图像渲染吗?

尝试通过订阅代码隐藏文件中的
图像来检查可能的异常。ImageFailed
事件:

public MainWindow()
{
    InitializeComponent();
    image.ImageFailed += ImageFailed;
}

private void ImageFailed(object sender, ExceptionRoutedEventArgs e)
{
    Console.WriteLine(e.ErrorException);
}

根据WebUrl,无法将其指定为BitmapImage的源。我建议您创建一个helper类,而不是在视图的代码隐藏中这样做。此外,我会冻结创建的图像以提高性能。

图像类型是什么?Windows 7本机支持这种类型吗?是的,它是PNG,有时是JPG。没有异国情调。你能从浏览器访问该链接吗?在我看来,这不像是xaml/c问题。更像是windows安装问题…是的,它在两个系统上都可以在浏览器中正常打开。可能是服务器问题、标题等。如果没有复制示例,很难判断。