muhsin muhsin
How to Display image from network in wpf
By muhsin muhsin in .NET on Dec 27 2010
  • muhsin muhsin
    Jan, 2011 11

    Thank you all for trying to help ------

    I solved the problem and  Here is my final code

    try

    {

    LoginPage login=new LoginPage();

    BitmapImage DriverPhoto=new BitmapImage();

    DriverPhoto.BeginInit();

    DriverPhoto.UriSource =new Uri(@"\\"+login.ServerName+"\\Photos\\MyPhoto.jpg");

    DriverPhoto.EndInit();

    DriverImageControl.Source=DriverPhoto;

    }

    catch(System.Exception ex)

    {

    System.Windows.MessageBox.Show(ex.Message);

    }

    • 0
  • Sumit Pathak
    Jan, 2011 10

    Check you path which you are sharing first. If are using peer to peer network then should not have any problem.Then check you code. Try Msdn library. Type your answer then see answer you I get most of answer either from or Msdn library. Also try  microsoft technet for developer.

     

    • 0
  • muhsin muhsin
    Dec, 2010 27

    Hi.....

    I have two  computers connected in peer to peer

    one computer named 'City' has a shared folder called 'Photos'

    I was able to send Image from another computer to city using

     

    File.copy("MyPhoto.jpg","\\City\Photos\MyPhoto.jpg",true);

    I tried to display this image From Photos folder as follow

    BitmapImage DriverPhoto=new BitmapImage();

    DriverPhoto.BeginInit();

    DriverPhoto.UriSource =new Uri("\\City\Photos\MyPhoto.jpg");   /////// I get Exception Here

    DriverPhoto.EndInit();

    DriverImageControl.Source=DriverPhoto;

    can anyone explain to me how to set Uri path correctly?

    thanks

     

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS