How to make drawLine smoother?
问题 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? 回答1: 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 回答2: Override the OnPaint() method of your form or implement the