The drawing looks distorted

  • Thread starter Thread starter avoriv
  • Start date Start date
A

avoriv

Guest
I use Visual Studio 2017 C# for drawing text in the Windows Application Form.
In the some cases, the drawing text looks distorted.
Sample code:

namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs e)
{
var format = new StringFormat(StringFormat.GenericTypographic);
format.Alignment = StringAlignment.Far;
e.Graphics.DrawString("\"WrapMode\" ", new Font("Arial", 10, FontStyle.Underline), SystemBrushes.ControlText, new RectangleF(0, 0, 90, 40), format);
format.Alignment = StringAlignment.Near;
e.Graphics.DrawString("\"WrapMode\" ", new Font("Arial", 10, FontStyle.Underline), SystemBrushes.ControlText, new RectangleF(90, 0, 80, 40), format);

base.OnPaint(e);
}
}
}

1303796.png

Continue reading...
 
Back
Top