Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 237
Ignacio Soler Garcia Avatar asked Jun 15 '10 15:06

Ignacio Soler Garcia


1 Answers

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);
like image 150
Pete Kirkham Avatar answered Oct 05 '22 23:10

Pete Kirkham