我的文档中有以下 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&ContentType=Image" />
</Border>
图像在 Win10 和 Win8 中显示正常,但在 Win7 中我得到的只是一个带有透明背景的红色边框,内部没有图像。当我使用静态 URL(例如 google Logo )时,它会在所有版本中呈现。
有人知道我如何在 Windows 7 中渲染图像吗?
最佳答案
根据 this post不能将 WebUrl 指定为 BitmapImage 的源。我建议您创建一个帮助程序类,而不是在 View 的代码隐藏中这样做。此外,我会卡住创建的图像以提高性能。
关于c# - 图像在 Win8/Win10 中呈现,但在 Win7 中不呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38925322/