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 static void TakeFullScreen() { Screen scr = PaintHelp.getCursorScreen(); Bitmap bmp = PaintHelp.GetScreen(new Point(scr.Bounds.X, scr.Bounds.Y), new Size(scr.Bounds.Width, scr.Bounds.Height)); new EditorEx(bmp); }
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_Load(object sender, EventArgs e) { //Point topLeft = PaintHelp.GetTopLeftMonitorPoint(); Point offsetPoint = new Point(fullRect.X, fullRect.Y); this.Location = offsetPoint; this.bmpDesktop = PaintHelp.GetScreen(offsetPoint, fullRect.Size); this.fntMeasure = PaintHelp.GetFont("Cambria", 48, FontStyle.Regular); }
public PartialScreenie() { fullRect = PaintHelp.getFullSize(); InitializeComponent(); this.Visible = false; this.Size = fullRect.Size; this.DoubleBuffered = true; this.Show(); }
private void RefreshImages() { if (checkEnabledWatermark.Checked) { pictureWatermark.Image = PaintHelp.setOpacity(PaintHelp.getWatermark(), Properties.Settings.Default.WatermarkOpacity); } else { pictureWatermark.Image = null; } GC.Collect(); }
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)); } }
public Main() { PaintHelp.FixDPIAwareness(); InitializeComponent(); Notification.Initialize(); string headerText = string.Format("InfiniPad v{0}", Globals.getVersion()); this.Icon = Properties.Resources.icon; this.Text = headerText; hk = new Hotkeys(); hk.ReapplyHotkeys(); Globals.CreateMoveDir(); fmMainWindow = this; #region movefile #if !DEBUG Globals.moveFile(Globals.MoveToDir + "InfiniPad.exe"); #endif #endregion }
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); } }
public static void TakeWindowScreen() { //takes a SS of the foreground window, needs to be completed //dllimport -> GetForegroundWindow() /*var hWnd = GetForegroundWindow(); * Rectangle rectBuffer = new Rectangle(); * GetWindowRect(hWnd, ref rectBuffer); * Bitmap bmp = PaintHelp.GetScreen(rectBuffer.Location, rectBuffer.Size); * new editor(bmp);*/ IntPtr hWnd = GetForegroundWindow(); RECT recBuff; GetWindowRect(hWnd, out recBuff); Rectangle recReal = new Rectangle(); recReal.X = recBuff.Left; recReal.Y = recBuff.Top; recReal.Width = recBuff.Right - recBuff.Left + 1; recReal.Height = recBuff.Bottom - recBuff.Top + 1; new EditorEx(PaintHelp.GetScreen(recReal.Location, recReal.Size)); }
public EditorEx(Bitmap Image) { InitializeComponent(); this.Icon = Properties.Resources.icon; curImg = Image; picEdit.Image = curImg; toolInUse = Tool.Pen; trackSize.Value = 6; penObj = new Pen(Properties.Settings.Default.PenColor, trackSize.Value); textToDraw = Properties.Settings.Default.TextDefault; textboxTextToDraw.Text = textToDraw; cursorLastPos = new Point(); bMouseDown = false; btnColor.BackColor = penObj.Color; if (Properties.Settings.Default.WatermarkEnabled) { PaintHelp.applyWatermark(ref curImg); picEdit.Image = curImg; } if (!Properties.Settings.Default.EditorEnabled) { UploadImage(); } else if (!this.Visible) { this.Show(); } funcList.Add(new tPen(this, Tool.Pen)); funcList.Add(new tBlur(this, Tool.Blur)); funcList.Add(new tCrop(this, Tool.Crop)); funcList.Add(new tText(this, Tool.Text)); funcList.Add(new tHighlighter(this, Tool.Highlighter)); }