Well, I\'m coding the OnPaint event for my own control and it is very nescessary for me to make it pixel-accurate.
I\'ve got a little problem with borders of rectangles.
You can do this by specifying PenAlignment
Pen pen = new Pen(Color.Black, 2); pen.Alignment = PenAlignment.Inset; //<-- this g.DrawRectangle(pen, rect);