,我與它的標題和評論在它旁邊顯示的圖像的圖。 當我加載了現有圖像我利用這個代碼:創建的BitmapImage拋出缺少關鍵例外
this.ArtifactIdentity = image.ArtifactIdentity;
this.Comment = image.Comment;
this.Name = image.Name;
this.MediaIdentity = image.MediaIdentity;
this.ImageArray = image.Image;
Image = new BitmapImage();
Image.BeginInit();
Image.CacheOption = BitmapCacheOption.None;
Image.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
Image.StreamSource = new MemoryStream(this.ImageArray);
Image.EndInit();
當我的execute()它拋出異常缺少參數鍵EndInit。堆棧跟蹤顯示這一點:
at System.Collections.Hashtable.ContainsKey(Object key)
at System.Collections.Hashtable.Contains(Object key)
at System.Windows.Media.Imaging.ImagingCache.RemoveFromCache(Uri uri, Hashtable table)
at System.Windows.Media.Imaging.BitmapImage.FinalizeCreation()
at System.Windows.Media.Imaging.BitmapImage.EndInit()
因此,誰能告訴我,當我使用的代碼,我看到很多人成功使用,但我得到這個例外,爲什麼我收到此異常???我很茫然!
什麼是確切的異常信息? – SLaks