示例#1
0
 private void CaptureArea()
 {
     var screenshot = ScreenshotProvider.TakeScreenshot(SystemInformation.VirtualScreen);
     var dialog = new SelectAreaDialog(screenshot);
     if (dialog.ShowDialog() == DialogResult.OK)
     {
         Bitmap croppedScreenshot = screenshot.Clone(
             dialog.SelectedArea,
             screenshot.PixelFormat);
         ProcessScreenshot(croppedScreenshot);
     }
     dialog.Dispose();
 }
示例#2
0
        private void CaptureArea()
        {
            var screenshot = ScreenshotProvider.TakeScreenshot(SystemInformation.VirtualScreen);
            var dialog     = new SelectAreaDialog(screenshot);

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                Bitmap croppedScreenshot = screenshot.Clone(
                    dialog.SelectedArea,
                    screenshot.PixelFormat);
                ProcessScreenshot(croppedScreenshot);
            }
            dialog.Dispose();
        }