Exemplo n.º 1
0
        private CShotResult[] get_all_shots()
        {
            int L = screens.Length;
            CShotResult[] shots = new CShotResult[L];

            for (int i = 0; i < L; i++)
            {
                shots[i] = get_shot(screens[i]);
            }
            return shots;
        }
Exemplo n.º 2
0
 private CShotResult get_shot(Screen screen)
 {
     Bitmap bmpShot = new Bitmap(
         screen.Bounds.Width,
         screen.Bounds.Height,
         PixelFormat.Format32bppArgb
     );
     Graphics gfxScreenshot = Graphics.FromImage(bmpShot);
     gfxScreenshot.CopyFromScreen(
         screen.Bounds.X,
         screen.Bounds.Y,
         0, 0,
         screen.Bounds.Size,
         CopyPixelOperation.SourceCopy
     );
     CShotResult result = new CShotResult(screen.DeviceName, bmpShot);
     return result;
 }
Exemplo n.º 3
0
 public void save_shot(CShotResult ShotResult)
 {
     string dir = get_destination_dir();
     if (dir != String.Empty)
     {
         string filename = dir + '\\' + ShotResult.Name + '_' + DateTime.Now.ToString("yyyyMMdd-HHmmss-fff");
         switch (settings.FileFormat)
         {
             case CShotActionSettings.IT_JPG:
                 save_as_jpg(ShotResult.Bmp, filename);
                 break;
             case CShotActionSettings.IT_PNG:
                 save_as_png(ShotResult.Bmp, filename);
                 break;
             default:
                 save_as_png(ShotResult.Bmp, filename);
                 break;
         }
     }
 }
Exemplo n.º 4
0
 private void NewFrame_Handler(object sender, NewFrameEventArgs eventArgs)
 {
     CShotResult shot = new CShotResult((sender as CMyVideoCaptureDevice).DeviceName, eventArgs.Frame);
     save_shot(shot);
     (sender as CMyVideoCaptureDevice).SignalToStop();
 }