// Function called from MainCapture each time counter is trigged public void Trigger_Capture() { if (cfs.Count - 1 < t.getNumberOfCaptures()) { MomentCapture.Capture(t, false); } }
// Save an image given by a task internal static void SaveIndexedImage(IPcPicture picture, IPcOutline outline, Task t) { string dir = Path.Combine(t.getFolder(), @"Captures\"); ToolBox.EnsureDirectoryExists(dir); int i = 0; foreach (IPcPicture image in picture.Children) { if (i == t.getIndex()) { // Check wether if a match is achieved between the expected and the obtained object. If not, a second capture is attempted // This is needed because of Sprout's capture errors, that often lead to wrong object identification if (ConfirmMatch(outline, i, t)) { string fileAndPath = Path.Combine(dir, DateTime.Now.ToString("MM-dd-yyyy_hh.mm.ss" + "_" + marker) + ".bmp"); ToolBox.SaveProcessedImage(image.Image, fileAndPath); List <Uri> l = new List <Uri>(); t.setCaptures(l); Uri u = new Uri(fileAndPath, UriKind.Relative); l.Add(u); App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.ApplicationIdle, new Action(() => t.getCaptureWindow().DrawImage(false))); //t.getCaptureWindow().DrawImage(false); ++i; } else { MomentCapture.Capture(t, true); } } i++; } }
// Function called from MainCapture each time counter is trigged public void Trigger_Capture() { MomentCapture.Capture(t); }
// Image captures samples public List <Image> Samples(List <string> folders, List <int> indexes) { List <Image> samples = MomentCapture.getSamples(folders, indexes); return(samples); }
// Outline capture public OutlineParameters ConfirmCapture() { OutlineParameters op = MomentCapture.ConfirmCapture(); return(op); }
// Image captures samples public object[] Samples(List <string> folders, List <int> indexes, List <PcPhysicalPoint> locations, List <System.Drawing.Point> sizes) { object[] returnable = MomentCapture.getSamples(folders, indexes, locations, sizes); return(returnable); }