Exemplo n.º 1
0
 public static Bitmap capture_Desktop(this API_Cropper cropper)
 {
     return((Bitmap)cropper.invokeOnThread(
                () => {
         cropper.toClipboard();
         cropper.CropperImageCapture.CaptureDesktop();
         return cropper.fromClipboardGetImage();
     }));
 }
Exemplo n.º 2
0
 public static Bitmap capture(this API_Cropper cropper, int x, int y, int width, int height)
 {
     return((Bitmap)cropper.invokeOnThread(
                () => {
         //"__current ApartmentState: {0}".info(System.Threading.Thread.CurrentThread.GetApartmentState());
         try
         {
             cropper.toClipboard();
             cropper.captureComplete.Reset();
             cropper.CropperImageCapture.Capture(x, y, width, height);
             cropper.waitForCapture();
             return cropper.LastImage;
             //return cropper.fromClipboardGetImage();
         }
         catch (Exception ex)
         {
             ex.log("in API_Cropper capture");
             return null;
         }
     }));
 }