views:

121

answers:

1

I'm having difficulty loading an image from a URL, when the request goes through a proxy. I have a url that will generate an image which I use to load a BitmapImage ( code below ).

This works great for any of my users that connect directly to the internet, however, if the user is behind a proxy, it will not work. Any ideas would be greatly appreciated, thanks.

BitmapImage bi = new BitmapImage();
bi.DownloadCompleted += new EventHandler( biCap_DownloadCompleted );
bi.DownloadFailed += new EventHandler<ExceptionEventArgs>( biCap_DownloadFailed );
bi.DownloadProgress += new EventHandler<DownloadProgressEventArgs>( biCap_DownloadProgress );
bi.BeginInit();
bi.UriSource = new Uri( myUrl );
bi.UriCachePolicy = new System.Net.Cache.RequestCachePolicy( System.Net.Cache.RequestCacheLevel.Reload );
bi.CacheOption = BitmapCacheOption.None;
bi.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bi.EndInit();
A: 

Well, as it appears, the above code works fine... my brain on the other hand is another question, and for another forum.

Capsule