public static Bitmap capture_Desktop(this API_Cropper cropper) { return((Bitmap)cropper.invokeOnThread( () => { cropper.toClipboard(); cropper.CropperImageCapture.CaptureDesktop(); return cropper.fromClipboardGetImage(); })); }
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; } })); }
public static API_Cropper showConfig(this API_Cropper cropper) { cropper.invokeOnThread(() => show.info(Configuration.Current)); return(cropper); }