public override void MouseUp(object sender, MouseEventArgs e) { Rectangle region = PaintHelp.fixNegRect(inst.cursorLastPos, e.Location); inst.curImg = PaintHelp.cropBitmap(inst.curImg, region); inst.picEdit.Image = inst.curImg; }
private void ScreenshotHelper_MouseUp(object sender, MouseEventArgs e) { try { Rectangle section = PaintHelp.fixNegRect(startP, endP); this.Visible = false; new EditorEx(PaintHelp.cropBitmap(bmpDesktop, section)); this.Close(); } catch (ArgumentException) { this.Close(); //This occurs when your startP and endP are the same } }