mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
Rectangle annotate tip changes
This commit is contained in:
parent
66db9ddf67
commit
1e78d98928
2 changed files with 12 additions and 7 deletions
|
@ -107,7 +107,7 @@ private set
|
|||
}
|
||||
}
|
||||
|
||||
public RectangleAnnotateOptions Options;
|
||||
public RectangleAnnotateOptions Options { get; private set; }
|
||||
|
||||
private Timer timer;
|
||||
private Image backgroundImage;
|
||||
|
@ -372,7 +372,7 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
private void DrawTips(Graphics g)
|
||||
{
|
||||
int offset = 10;
|
||||
int padding = 2;
|
||||
int padding = 3;
|
||||
|
||||
string tipText;
|
||||
|
||||
|
@ -396,15 +396,18 @@ private void DrawTips(Graphics g)
|
|||
}
|
||||
|
||||
using (GraphicsPath backgroundPath = new GraphicsPath())
|
||||
using (Brush brush = new SolidBrush(Color.FromArgb(150, Color.White)))
|
||||
using (Pen pen = new Pen(Color.FromArgb(150, Color.Black)))
|
||||
using (Brush brush = new SolidBrush(Color.FromArgb(175, Color.White)))
|
||||
using (Pen pen = new Pen(Color.FromArgb(175, Color.Black)))
|
||||
{
|
||||
backgroundPath.AddRoundedRectangle(textRectangle, 5);
|
||||
g.FillPath(brush, backgroundPath);
|
||||
g.DrawPath(pen, backgroundPath);
|
||||
}
|
||||
|
||||
ImageHelpers.DrawTextWithShadow(g, tipText, new PointF(textRectangle.X + padding, textRectangle.Y + padding), tipFont, Color.Black, Color.WhiteSmoke);
|
||||
using (StringFormat sf = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center })
|
||||
{
|
||||
g.DrawString(tipText, tipFont, Brushes.Black, textRectangle, sf);
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRectangleInfo(Graphics g)
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace ScreenCaptureLib
|
|||
{
|
||||
public class RectangleLight : Form
|
||||
{
|
||||
public static Rectangle LastSelectionRectangle0Based;
|
||||
public static Rectangle LastSelectionRectangle0Based { get; private set; }
|
||||
|
||||
public Rectangle ScreenRectangle { get; private set; }
|
||||
|
||||
|
@ -131,10 +131,12 @@ private void InitializeComponent()
|
|||
Text = "ShareX - Rectangle Capture Light";
|
||||
ShowInTaskbar = false;
|
||||
TopMost = true;
|
||||
|
||||
Shown += RectangleLight_Shown;
|
||||
KeyUp += RectangleLight_KeyUp;
|
||||
MouseDown += RectangleLight_MouseDown;
|
||||
MouseUp += RectangleLight_MouseUp;
|
||||
|
||||
ResumeLayout(false);
|
||||
}
|
||||
|
||||
|
@ -228,7 +230,7 @@ protected override void OnPaint(PaintEventArgs e)
|
|||
|
||||
using (Font font = new Font("Arial", 17, FontStyle.Bold))
|
||||
{
|
||||
ImageHelpers.DrawTextWithOutline(g, string.Format("{0}, {1}\r\n{2} x {3}", SelectionRectangle.X, SelectionRectangle.Y,
|
||||
ImageHelpers.DrawTextWithOutline(g, string.Format("X:{0} Y:{1}\r\n{2} x {3}", SelectionRectangle.X, SelectionRectangle.Y,
|
||||
SelectionRectangle.Width, SelectionRectangle.Height), position, font, Color.White, Color.Black);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue