Ignacio Soler Garcia
Ignacio Soler Garcia

Reputation: 21855

How to draw a single point with .Net?

this should be pretty simple but I don't get it. How can I draw a single point in .Net? If I use g.DrawLine(Black,0,0,0,0) nothing is drawn and if I use g.DrawLine(Black,0,0,1,0) a line with 2 dots is used. The same happens with g.DrawRectangle. This has me intrigued.

Upvotes: 8

Views: 5425

Answers (1)

Pete Kirkham
Pete Kirkham

Reputation: 49331

The easiest way is to fill a rectangle which is one pixel wide rather than using a pen:

 e.Graphics.FillRectangle(Brushes.Red, 42, 12, 1, 1);

Upvotes: 10

Related Questions