private void UpdateCropSettings() { if (!loadingSettings) { CropSettings = new Rectangle((int)numTopLeftRectX.Value, (int)numTopLeftRectY.Value, (int)numBottomRightRectX.Value, (int)numBottomRightRectY.Value); CroppedBitmapPrinter = new CroppedBitmapPrinter(BitmapPrinter, CropSettings); } }
public LoadRemoverComponentSettings() { InitializeComponent(); ColorTolerance = 10; CropSettings = new Rectangle(0, 0, previewPictureBox.Width, previewPictureBox.Height); BitmapPrinter = new DummyPrinter(); CroppedBitmapPrinter = new CroppedBitmapPrinter(BitmapPrinter, CropSettings); RefreshCaptureWindowList(); }
private void UpdatePreview() { Bitmap bitmap = BitmapPrinter.CaptureImage(); previewPictureBox.Image = bitmap.ResizeImage(previewPictureBox.Width, previewPictureBox.Height); CropSettings = new Rectangle((int)numTopLeftRectX.Value, (int)numTopLeftRectY.Value, (int)numBottomRightRectX.Value, (int)numBottomRightRectY.Value); CroppedBitmapPrinter = new CroppedBitmapPrinter(BitmapPrinter, CropSettings); croppedPreviewPictureBox.Image = CroppedBitmapPrinter.CaptureImage().ResizeImage(croppedPreviewPictureBox.Width, croppedPreviewPictureBox.Height); }
public CroppedBitmapPrinter(IBitmapPrinter bitmapPrinter, Rectangle cropSettings) { _bitmapPrinter = bitmapPrinter; _cropSettings = cropSettings; }