I use the following code to draw line:
Graphics g = this.CreateGraphics();
Pen p = new Pen(Color.Black,3);
g.DrawLine(p,...);
// ...
Why the straight line is zigzag kind of, not straight and smooth at all. How could I make it straight and smoother?
You need to enable anti-aliasing. Set Graphics.SmoothingMode
to AntiAlias
as described here: http://msdn.microsoft.com/en-us/library/system.drawing.graphics.smoothingmode.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With