How to draw a one pixel line

A

Angelina

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top