public override void MouseUp(object sender, MouseEventArgs e) { Rectangle region = PaintHelp.fixNegRect(inst.cursorLastPos, e.Location); inst.curImg.Blur(region, inst.trackSize.Value / 2); inst.picEdit.Image = inst.curImg; }
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; }
public override void Paint(object sender, PaintEventArgs e) { inst.paintCrossCursor(e.Graphics); if (inst.bMouseDown) { e.Graphics.DrawOutlinedRect(PaintHelp.fixNegRect(inst.cursorLastPos, inst.getPointOnImage()), Brushes.Blue, 2); } }
public override void Paint(object sender, PaintEventArgs e) { inst.paintCrossCursor(e.Graphics); if (inst.bMouseDown) { e.Graphics.DrawAroundRect(PaintHelp.fixNegRect(inst.cursorLastPos, inst.getPointOnImage()), new Rectangle(0, 0, inst.curImg.Width, inst.curImg.Height), new SolidBrush(Color.FromArgb(128, 0, 0, 0))); } }
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 } }
private void paintHighlighter(Graphics g, int opacity, bool isRect = false) { Point curPoint = getPointOnImage(); Pen tempPen = new Pen(Color.FromArgb(opacity, penObj.Color), 3); if (isRect) { g.FillRectangle(new SolidBrush(tempPen.Color), PaintHelp.fixNegRect(new Point(curPoint.X, curPoint.Y - trackSize.Value), new Point(cursorLastPos.X, curPoint.Y + trackSize.Value))); } else { g.DrawLine(tempPen, new Point(curPoint.X, curPoint.Y + trackSize.Value), new Point(curPoint.X, curPoint.Y - trackSize.Value)); } }
private void ScreenshotHelper_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; g.DrawImage(bmpDesktop, new Point(0, 0)); if (startP.IsEmpty) { g.FillRectangle(rectBrush, new Rectangle(0, 0, fullRect.Width, fullRect.Height)); } else { Rectangle drawArea = PaintHelp.fixNegRect(startP, endP); g.DrawOutlinedRect(drawArea, outlineBrush, 3); g.DrawAroundRect(drawArea, new Rectangle(0, 0, fullRect.Width, fullRect.Height), rectBrush); g.DrawRotatedText(Math.Abs(startP.X - endP.X).ToString(), fntMeasure, measBrush, new PointF(drawArea.X, drawArea.Y + drawArea.Size.Height), 0); string ySize = Math.Abs(startP.Y - endP.Y).ToString(); g.DrawRotatedText(ySize, fntMeasure, measBrush, new PointF(drawArea.X - g.MeasureString(ySize, fntMeasure).Height - 10, drawArea.Y + drawArea.Size.Height - g.MeasureString(ySize, fntMeasure).Width), -90); } }