public void CreateNewScreenshot() { if (!GetIsSelectedRectangleValid()) { Close(); return; } // Only get the rectangle portion of the dekstop we want Bitmap croppedBitmap = BitmapService.CropBitmap(OriginalScreenBitmap, GetSelectedCaptureArea()); // When creating the new Screenshot form, make sure to place it on the relevant part of the desktop var topLeftPoint = GetTopLeftPoint(); // Apply offset var leftMostScreen = Screen.AllScreens.OrderBy(s => s.Bounds.Left).First(); var leftMostLocation = leftMostScreen.Bounds.Location; topLeftPoint.X += DesktopRectangle.X; topLeftPoint.Y += DesktopRectangle.Y; // TODO: Add Screenshots to groups (for grouped moving etc.) var screenshotModel = new ScreenshotModel(croppedBitmap, topLeftPoint); var newScreenshotForm = new ScreenshotView(); var screenshotPresenter = new ScreenshotPresenter(newScreenshotForm, screenshotModel); newScreenshotForm.SetBitmap(croppedBitmap, topLeftPoint); newScreenshotForm.Show(); Close(); }
void ReleaseDesignerOutlets() { if (ConnectBtn != null) { ConnectBtn.Dispose(); ConnectBtn = null; } if (DebugLbl != null) { DebugLbl.Dispose(); DebugLbl = null; } if (ScreenBtn != null) { ScreenBtn.Dispose(); ScreenBtn = null; } if (ScreenshotView != null) { ScreenshotView.Dispose(); ScreenshotView = null; } if (ScrenShotImageView != null) { ScrenShotImageView.Dispose(); ScrenShotImageView = null; } if (URL_textfield != null) { URL_textfield.Dispose(); URL_textfield = null; } if (VideoContentView != null) { VideoContentView.Dispose(); VideoContentView = null; } }