Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

How to get a photo from Server and display it in Image Control

Back to Forum: Tech Off
  • User profile image
    iNature

    Hi,

    I am not familiar with HttpWebRequest for Wp7. Can someone show me a sample code for the above that use HttpWebRequest. Would appreciate your kind help.

     

    Thanks

  • User profile image
    ManipUni

    Add the image control like this:
     <asp:Image ID="Image1" runat="server" />

    Then point to the picture you want in it from C# like this:
    Image1.ImageUrl = "http://www.huddletogether.com/projects/lightbox2/images/image-2.jpg";

    Now the image will display. If you want to display a local image just repoint the URL to a relative URL locally.

    PS - I read about HttpWebReques, but will need more information about what you actually want to accomplish. Seems like an over-engineered simple problem at the moment. 

  • User profile image
    iNature

    Hi,

    I perfectly understand the power of Asp.net and I have no problem using it to display photo retrieve from Server. However, it seems HttpWebrequest works differently in Silverlight.

    What I wanted to do is to use Wp7 to remotely retrieve photo or image from the Server and display it in the Image Control.

    Understand the displaying photo method is very different in Wp7 when using HttpWebRequest as compare to Asp.net.

    I need help on this. Hope you can show me a sample code to see how it works..

     

    Thanks

  • User profile image
    spivonious

    @iNature: I haven't done any WP7 work yet, but couldn't you just put this in the xaml?

    <Image Source="location of image"/>

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.