How to draw a one pixel line

  • Thread starter Thread starter Guest
  • Start date Start date
Just override the onpaint event of your form and write down :

protected override void OnPaint(PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawLine(new Pen(Color.Black), x1, y1, x2, y2);
//x1, y1 is start point and x2, y2 is end point of the line
base.OnPaint (e);
}

cheers ;)
- Angelina
 
Back
Top