private void MouseDown(object sender, WindowsHookLib.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { pressingLMouseBtn = true; if (pressingPrintAreaBtns()) { // start screen selection mouseStartPos = e.Location; printSelection = new PrintAreaSelection(mouseStartPos); } } }
private void MouseMove(object sender, WindowsHookLib.MouseEventArgs e) { if (pressingPrintAreaBtns()) { Point currentMousePos = e.Location; printSelection.Select(new Rectangle(mouseStartPos, currentMousePos)); } }
private void MouseUp(object sender, WindowsHookLib.MouseEventArgs e) { if (e.Button == MouseButtons.Left) { if (pressingPrintAreaBtns()) { // stop screen selection printSelection.Deselect(); mouseStopPos = e.Location; PrintScreen(mouseStartPos, mouseStopPos); } pressingLMouseBtn = false; } }