Image doesn't display when URL is used
I have an Image (DragImage) on an InkCanvas. I'm replacing the UniformSource property of the image. This process leaves me with an empty image box. If I repeat the process a 2nd time then the box has the appropriate image in it. If I restart the application the problem comes back.
This problem only occurs when the URI is a URL. If I use a UNC page to the same image there is no problem.
Seems like a caching issue of some kind. Any ideas? Can I force the Image to reload after I change the UniformSource?
//element is a reference to a UIElement on the InkCanvas
// This path doesn't work
string path =http://www.mysite.com//LiveImages/10351_hq.jpg;
// This path works
//path ="\\\\server\\d$\\\liveimages\\10351_hq.jpg";
Uri u =newUri(path,UriKind.Absolute);
System.Windows.Media.Imaging.BitmapImage bi =new System.Windows.Media.Imaging.BitmapImage();
bi.BeginInit();
bi.CacheOption = System.Windows.Media.Imaging.BitmapCacheOption.OnLoad;
bi.DecodePixelWidth =Convert.ToInt16(((System.Windows.Media.Imaging.CroppedBitmap)di.Source).Source.Width);
bi.DecodePixelHeight =Convert.ToInt16(((System.Windows.Media.Imaging.CroppedBitmap)di.Source).Source.Height);
bi.UriSource = u;
bi.EndInit();
System.Windows.Media.Imaging.CroppedBitmap cb =new System.Windows.Media.Imaging.CroppedBitmap(bi, cropped.SourceRect);
((DragImage)element).UniformSource = cb;

