mirror of
https://github.com/ShareX/ShareX.git
synced 2024-08-15 02:01:49 +12:00
Use anti aliasing for text drawing
This commit is contained in:
parent
9ab94c9fec
commit
63c685bf1d
1 changed files with 3 additions and 0 deletions
|
@ -28,6 +28,7 @@ You should have received a copy of the GNU General Public License
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Drawing.Drawing2D;
|
using System.Drawing.Drawing2D;
|
||||||
|
using System.Drawing.Text;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -84,7 +85,9 @@ public override void OnDraw(Graphics g)
|
||||||
using (Brush textBrush = new SolidBrush(Options.Color))
|
using (Brush textBrush = new SolidBrush(Options.Color))
|
||||||
using (StringFormat sf = new StringFormat { Alignment = Options.AlignmentHorizontal, LineAlignment = Options.AlignmentVertical })
|
using (StringFormat sf = new StringFormat { Alignment = Options.AlignmentHorizontal, LineAlignment = Options.AlignmentVertical })
|
||||||
{
|
{
|
||||||
|
g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
|
||||||
g.DrawString(Text, font, textBrush, Rectangle, sf);
|
g.DrawString(Text, font, textBrush, Rectangle, sf);
|
||||||
|
g.TextRenderingHint = TextRenderingHint.SystemDefault;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue