Quantcast
Channel: Displaying Images
Viewing all articles
Browse latest Browse all 5

Displaying Images

$
0
0

 I use the following in my Silverlight code

1    string host = App.Current.Host.Source.ToString();2    host = host.Substring(0, host.IndexOf("/ClientBin"));3    WebClient localwebclient = new WebClient();4    localwebclient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(localwebclient_DownloadStringCompleted);5    localwebclient.DownloadStringAsync(new Uri(String.Format("{0}/{1}", host, DATAFILE)));

  

Obviously this is for data file downloads but the DownloadStringAsync takes a URI which is the bit you are looking for, last line.

Just change the String.Format to

String.Format("{0}/{1}/{2}",host, DATAFOLDER, IMAGEFILE)

setting DATAFOLDER to your data folder and IMAGEFILE to your image.


Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>