Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7849525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:33:09+00:00 2026-06-02T18:33:09+00:00

In my XAML, I have: <Image Height=150 HorizontalAlignment=Left Margin=0,4,0,0 Name=imgLogo Stretch=Fill VerticalAlignment=Top Width=417 />

  • 0

In my XAML, I have:

<Image Height="150" HorizontalAlignment="Left" Margin="0,4,0,0" Name="imgLogo" Stretch="Fill" VerticalAlignment="Top" Width="417" />
<Image Height="343" HorizontalAlignment="Left" Margin="0,155,0,0" Name="imgPhoto" Stretch="Fill" VerticalAlignment="Top" Width="417" />

In the C# code behind, I have:

WebClient wcForLogo = new WebClient();
wcForLogo.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wcForLogo_DownloadStringCompleted);
wcForLogo.DownloadStringAsync(new Uri("http://mySite/logo.gif"));

WebClient wcForPhoto = new WebClient();
wcForPhoto.DownloadStringCompleted += new DownloadStringCompletedEventHandler(wcForPhoto_DownloadStringCompleted);
wcForPhoto.DownloadStringAsync(new Uri("http://mySite/photo.jpg"));

But now I don’t know how to catch the image and post it in the XAML controls I built.

2 questions:

  1. Is there a way to copy the e.Result directly to the Image controls, or should I cache the image and use the cache as the source, or should I save the image to the isolated storage and then use that as the source, then delete the image when I’m done with it? Whichever case, could you please show me how with code?
  2. Are GIF’s and JPG’s dealt with differently? If so, can you show me the 2 different ways?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:33:11+00:00Added an answer on June 2, 2026 at 6:33 pm

    If you just want to display the picture, you don’t have to use a WebClient. You can set the Uri directly in the image source, and the control will take care of the downloading:

    imgLogo.Source = new BitmapImage(new Uri("images/yourPicture.png", UriKind.Relative));
    

    Note that GIF aren’t supported by the Image control. You can still display them by using the converter from the ImageTools library: Display GIF in a WP7 application with Silverlight

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have I need XAML: <Image Height=500 MouseLeftButtonDown=image_MouseLeftButtonDown MouseRightButtonDown=image_MouseRightButtonDown Name=image Stretch=Fill Width=500 />` C#:
I have a Silverlight image. <Image Source=pics/pic1.png Stretch=Fill Canvas.Left=50 Canvas.Top=50 Width=100 Height=100 MouseLeftButtonUp=startRandomAnim> <Image.Resources>
I have something like this in my xaml: <Grid> <Image Name=image Source=../../Images/DefaultImage.png HorizontalAlignment=Stretch VerticalAlignment=Stretch></Image>
the thing that we do in xaml like this <Image Height=136 HorizontalAlignment=Center x:Name=image1 Stretch=Fill
hei, assume that i have this code: <StackPanel> <Canvas x:Name=canvas Height=400 Width=235> <Image x:Name=image
In Xaml code, I set the width and height of an Image to Auto.
I have the following xaml for changing the image for WPF button when mouse
I have XAML that looks as follows: <DataTemplate x:Key=CdTeThickness> <Grid> <Grid.RowDefinitions> <RowDefinition Height=Auto />
I have this XAML: <UserControl x:Class=Foo.UserControls.Bar x:Name=FooBar xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml> <StackPanel> <WrapPanel Margin=4,0,0,0> <Button Command={Binding
In a WPF Application using XAML, I created a stackpanel(width 1030) and I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.