public void RegionScreenshot() { var regSelect = new RegionSelectionWindow(); regSelect.RegionSelected += RegionSelected; regSelect.Show(); regSelect.Activate(); regSelect.Focus(); ManagedRect r; var hwnd = new WindowInteropHelper(regSelect).Handle; if (GetWindowRect(hwnd, out r)) { regSelect.XOffset = r.Left; regSelect.YOffset = r.Top; } }
public void RegionScreenshot() { var regSelect = new RegionSelectionWindow(); regSelect.RegionSelected += RegionSelected; regSelect.Show(); regSelect.Activate(); regSelect.Focus(); ManagedRect r; var hwnd = new WindowInteropHelper(regSelect).Handle; if (GetWindowRect(hwnd, out r)) { regSelect.XOffset = r.Left; regSelect.YOffset = r.Top; } }
private void RegionSelected(RegionSelectionWindow.RegionSelectedEventArgs e, object sender) { var s = this.scr.GetScreenshot(e.X0 + e.XOffset, e.Y0 + e.YOffset, e.X1 + e.XOffset, e.Y1 + e.YOffset); this.UploadScreenshot(s); }