Esempio n. 1
0
 /// <summary>
 /// Camキャプチャーメイン処理
 /// </summary>
 void camCaptureTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (!CamCaptureBusy)
     {
         try {
             CamCaptureBusy = true;
             FpsAct.Value   = 1000d / (DateTime.Now - lastTime).Milliseconds;
             lastTime       = DateTime.Now;
             CapturedBmp    = CamNewFrame(cam);
             Potrace.Trace(CapturedBmp, (int)TraceThreshold, TracePitch);
             tracedSvgStr      = traceSvgStr;
             tracedFaces       = Potrace.TraceFaces(traceSvgStr);
             CapturedBmf.Value = CapturedBmp.ToBitmapFrame();
             TracedBmf.Value   = TracedBmp.ToBitmapFrame();
             CamCaptureBusy    = false;
         } catch (Exception) { }
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Scrキャプチャーメイン処理
 /// </summary>
 void scrCaptureTimerElapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (!ScrCaptureBusy)
     {
         try {
             ScrCaptureBusy = true;
             FpsAct.Value   = 1000d / (DateTime.Now - lastTime).Milliseconds;
             lastTime       = DateTime.Now;
             CapturedBmp    = ScreenCapture.Instance.CaptureScreen((int)DocPoint.X, (int)DocPoint.Y, (int)DocSize.Width, (int)DocSize.Height);
             CapturedBmp.Save(@"C:\Users\tg30266\Desktop\test.png");
             Potrace.Trace(CapturedBmp, (int)TraceThreshold, TracePitch);
             tracedSvgStr      = traceSvgStr;
             tracedFaces       = Potrace.TraceFaces(traceSvgStr);
             CapturedBmf.Value = CapturedBmp.ToBitmapFrame();
             TracedBmf.Value   = TracedBmp.ToBitmapFrame();
             ScrCaptureBusy    = false;
         } catch (Exception) { ScrCaptureBusy = false; }
     }
 }