private void menuApplyToWholeOrder(object sender, EventArgs e) { string thisOrder; string thisRoll; string thisFrame; using (LoadingMessage lm = new LoadingMessage()) { lm.StartPosition = FormStartPosition.CenterScreen; lm.ChangeMessage("Applying correction to entire job."); lm.Show(); Application.DoEvents(); List<FileInfo> orderedList = GetOrderedList(); //Extrapolate full path and add to monitor file list foreach (var file in orderedList) { int count = file.Name.Count(f => f == '_'); if (count == 2) { string[] pieces = file.Name.Split('_'); thisOrder = pieces[0]; thisRoll = pieces[1]; thisFrame = pieces[2].Replace(".jpg", ""); if (thisOrder == menuOrder) { KeepOriginalRotation(file.Name); } } } foreach (Thumbnail control in thumbPanel.Controls) { control.UpdateThumbnail(); control.FixSize(); } lm.Close(); } }
private void CreateThumbs(string scanTargetPath) { string thisJob = scanTargetPath.Replace(@"\\photoserver\FilmSystem\Orders\", "").Replace(@"\1 - Scanned", "").Replace(@"\5 - Rescanned", ""); string thumbPath = Path.Combine(scanTargetPath, "0 - Thumbs").Replace(@"\1 - Scanned", ""); DirectoryInfo di = new DirectoryInfo(scanTargetPath); FileInfo[] fileList = di.GetFiles("*_*.jpg"); using (LoadingMessage lm = new LoadingMessage()) { lm.ChangeMessage("No thumbnails found. Crushing " + fileList.Count() + " images from job " + thisJob + "."); lm.StartPosition = FormStartPosition.CenterScreen; lm.Show(); Application.DoEvents(); foreach (FileInfo file in fileList) { using (var bitmap = new Aurigma.GraphicsMill.Bitmap(file.FullName)) { bitmap.Transforms.Resize(700, 0); bitmap.Save(Path.Combine(thumbPath, thisJob + "_" + file.Name)); } } CopyThumbs(thumbPath, fileList.Count(), thisJob); lm.Close(); } }
private void ShowContactSheet() { try { LoadingMessage lm = new LoadingMessage(); lm.StartPosition = FormStartPosition.CenterScreen; lm.ChangeMessage("Loading contact sheet..."); lm.Show(); Application.DoEvents(); using (ContactSheet cs = new ContactSheet()) { cs.StartPosition = FormStartPosition.CenterScreen; cs.PopulateContactSheet(); lm.Dispose(); cs.ShowDialog(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void CopyThumbs(string thumbPath, int thumbCount, string jobNum) { using (LoadingMessage lm = new LoadingMessage()) { lm.ChangeMessage("Loading " + thumbCount + " thumbnails from job " + jobNum + "."); lm.StartPosition = FormStartPosition.CenterScreen; lm.Show(); Application.DoEvents(); DirectoryInfo dir = new DirectoryInfo(thumbPath); foreach (FileInfo fi in dir.GetFiles()) { fi.CopyTo(Path.Combine(ccFolder, "Thumbs", fi.Name)); } lm.Close(); } }