I’m losing my mind over this one. Can anyone spot an error in my code following this comment as it is giving me a NullReferenceException error at the point highlighted…. Thanks in advance for any suggestions…
//retreive the picture from isolated storage
Stream file = PicturesLoader.LoadFileFromStorage(PhoneApplicationService.Current.State[PictureCrop.PictureStateKey_Url].ToString());
BitmapImage bi = new BitmapImage();
bi.SetSource(file);
//load _pic
Picture _pic = new Picture();
_pic.Name = "TempFile";
_pic.Url = PhoneApplicationService.Current.State[PictureCrop.PictureStateKey_Url].ToString();
_pic.Height = bi.PixelHeight;
_pic.Width = bi.PixelWidth;
_pic.Bitmap = bi;
//save the new cropped image for later use
file.Seek(0, SeekOrigin.Begin);
App._capturedImage.SetSource(file); <------ THROWS ERROR HERE, suggest file = NullReferenceException ???????????????????
//Get rid of the stream....
file.Dispose();
A shot in the dark: probably
_capturedImageis thenullone.