loading error ExtendedImage.webClient_OpenReadCompleted

Jul 4, 2011 at 9:50 AM
Edited Jul 4, 2011 at 9:50 AM

hello,

this is my code :

here are the decoder statements at the top of the page:

ImageTools.IO.Decoders.AddDecoder<BmpDecoder>();
ImageTools.IO.Decoders.AddDecoder<GifDecoder>();
ImageTools.IO.Decoders.AddDecoder<PngDecoder>();

ex_img = new ExtendedImage();
            ex_img.LoadingCompleted += ExtendedImage_LoadingCompleted;
            ex_img.UriSource = new Uri("/Images/0_0.gif",UriKind.Relative);
        }
        private void ExtendedImage_LoadingCompleted(object sender, EventArgs e)
        {
            ExtendedImage image = (ExtendedImage)sender;
            Dispatcher.BeginInvoke(() =>
                                   {
                                       var bitmap = image.ToBitmap();
                                           im.Source = bitmap;
                                   });
            // Image is now loaded.
  }

 

error :

Erreur : Unhandled Error in Silverlight Application Une exception s'est produite lors de l'opération, ce qui rend le résultat non valide. Consultez InnerException pour plus de détails sur l'exception.   à System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   à System.Net.OpenReadCompletedEventArgs.get_Result()
   à ImageTools.ExtendedImage.webClient_OpenReadCompleted(Object sender, OpenReadCompletedEventArgs e)
   à System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
   à System.Net.WebClient.OpenReadOperationCompleted(Object arg)

what is wrong ?

please help me thank