Hi, I want to use a remote URL as an Image source. I have tried different things, but noting worked -.-.
My code looks like this:
<Grid Height="500" HorizontalAlignment="Left" Margin="0,0,0,0" Name="grid1" VerticalAlignment="Top" Width="470" Background="{x:Null}">
<Image Height="109" HorizontalAlignment="Left" Margin="240,19,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="180" MaxHeight="50" />
</Grid>
Now I want to add the image source like this:
var imgurl = "http://www.blab/blabla.jpg";
image2.Source = new BitmapImage(new Uri(imgurl));
The problem is, this does not work -.-
Has anyone an idea what is wrong? I'm trying the last two nights, but I can't find the mistake
My code looks like this:
<Grid Height="500" HorizontalAlignment="Left" Margin="0,0,0,0" Name="grid1" VerticalAlignment="Top" Width="470" Background="{x:Null}">
<Image Height="109" HorizontalAlignment="Left" Margin="240,19,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="180" MaxHeight="50" />
</Grid>
Now I want to add the image source like this:
var imgurl = "http://www.blab/blabla.jpg";
image2.Source = new BitmapImage(new Uri(imgurl));
The problem is, this does not work -.-
Has anyone an idea what is wrong? I'm trying the last two nights, but I can't find the mistake