Image Renders in Win8 / Win10, but not Win7

I have the following XAML in my document:

<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> 

The image is clearly visible in Win10 and Win8, but in Win7 all I get is a red frame with a transparent background and no image inside. When I use a static URL, for example, for the google logo, it appears in all versions.

Does anyone know how I can do image rendering in Windows 7?

+5
source share
2 answers

According to this message, WebUrl cannot be specified as the source of BitmapImage. I recommend that you instead create a helper class instead of code. I would also freeze the created image for performance.

+2
source

Try to check for a possible exception by subscribing to the Image.ImageFailed event from the code file:

 public MainWindow() { InitializeComponent(); image.ImageFailed += ImageFailed; } private void ImageFailed(object sender, ExceptionRoutedEventArgs e) { Console.WriteLine(e.ErrorException); } 
+2
source

All Articles