7

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Ignacio Soler Garcia
  • 21,122
  • 31
  • 128
  • 207
  • 1
    possible duplicate of [Draw a single pixel on Windows Forms](http://stackoverflow.com/questions/761003/draw-a-single-pixel-on-windows-forms) – H H Jun 15 '10 at 15:46

1 Answers1

9

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);
Pete Kirkham
  • 48,893
  • 5
  • 92
  • 171