private void Save_Click(object sender, EventArgs e) { SavePhoto savePhoto = new SavePhoto(); savePhoto.SaveToCameraRoll(imageName); savePhoto = null; MessageBox.Show("Image Saved to Camera Roll!"); GC.Collect(); }
void pc_Completed(object sender, PhotoResult e) { try { string originalFileName = Path.GetFileName(e.OriginalFileName); SavePhoto savePhoto = new SavePhoto(); savePhoto.SaveImageToIsolatedStorage(e.ChosenPhoto, originalFileName, 0, 100); savePhoto = null; AdvancedTextIO advancedTextIO = new AdvancedTextIO(); string[] fileNames = storage.GetFileNames(); short lineNumber = advancedTextIO.FindTextInLine(originalFileName); if (usingTextView == false) { FileStream isoStream = storage.OpenFile(fileNames[lineNumber], FileMode.Open, FileAccess.Read); photoList.Dispatcher.BeginInvoke(() => { Image image = new Image(); image.Source = PictureDecoder.DecodeJpeg(isoStream, 155, 155); image.Width = 142; image.Height = 142; image.Stretch = System.Windows.Media.Stretch.UniformToFill; image.Margin = new Thickness(5, 0, 5, 10); photoList.Items.Insert(lineNumber, image); isoStream.Dispose(); }); } else { photoList.ItemsSource = fileNames; } advancedTextIO = null; GC.Collect(); } catch {} }
void pc_Completed(object sender, PhotoResult e) { try { string originalFileName = Path.GetFileName(e.OriginalFileName); SavePhoto savePhoto = new SavePhoto(); savePhoto.SaveImageToIsolatedStorage(e.ChosenPhoto, originalFileName, 0, 100); savePhoto = null; if (usingTextView == false) { photoList.Items.Clear(); i = 0; bw.RunWorkerAsync(); } else { photoList.Items.Clear(); refreshView(); } GC.Collect(); } catch {} }