void camera_NewFrame(object sender, EventArgs e) { Invalidate(); if (camera != null) { try { camera.Lock(); filterBmp = new Bitmap(camera.LastFrame); PCT_CANVAS.Image = Convolver.Execute(filterBmp, SOBEL_Gx);//Sobel.Execute(YUV.Execute(filterBmp)); MyDelegates.SetControlTextValue(LBL_IMAGE_SIZE, camera.LastFrame.Size); } catch (Exception ex) { MyDelegates.SetControlTextValue(LBL_IMAGE_SIZE, ex); } finally { camera.Unlock(); } if (camera.FramesReceived % 12 == 0) { thread = new Thread(Clean); thread.Start(); } } }
/// <p> /// Recursive method that iterates through the directory files /// applying the same process /// <p> private void ProcessFolder() { DirectoryInfo dirInfo = Directory.CreateDirectory(info.DirectoryName + @"\PROCESS"); for (int i = 0; i < fileEntries.Length; i++) { try { filterBmp = new Bitmap(fileEntries[i]); ColorFinder.Execute(filterBmp, MIN, MAX).Save(dirInfo.FullName + @"\000" + i + ".PNG"); } catch (Exception) { } } MyDelegates.SetControlTextValue(LBL_STAT, "Done"); }