コード例 #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;
        }
コード例 #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;
 }
コード例 #3
0
ファイル: CShotAction.cs プロジェクト: resteem/ShotMonitor
 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;
         }
     }
 }
コード例 #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();
 }