SE1*_*013 3 .net c# gdi+ gdi winforms
所以我试着画一个X:
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
e.Graphics.DrawLine(new Pen(Color.Black, 1),
this.Width + 20 - 50,
20,
this.Width + 25 - 50,
10);
e.Graphics.DrawLine(new Pen(Color.Black, 1),
this.Width - 20 + 50,
20,
this.Width + 25 - 50,
10);
Run Code Online (Sandbox Code Playgroud)
但它看起来像一把斧头。无论我为第二行代码设置哪个值,它都是不正确的。
10 x 10 X 只需添加位置自身
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
e.Graphics.DrawLine(new Pen(Color.Black, 1),
1,
1,
10,
10);
e.Graphics.DrawLine(new Pen(Color.Black, 1),
1,
10,
10,
1);
Run Code Online (Sandbox Code Playgroud)