Problem with dashed line


I need to draw rectangle with dashed line and for that I'm using custom pen as per below code:
mPen = new Pen(Color.FromArgb(255,255,0,0)); mPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; mPen.DashPattern = new Single[] { 1, 1 }; mRect = new GoRectangle(); mRect.Location = new Point(5, 5); mRect.Size = new Size(11, 11); mRect.Pen = mPen; goView1.Document.Add(mRect);
If you look at this rectangle at 16 zoom level, you can see that top left corner and bottom right corner dash are broken. Please see image below: Can someone please help with how to fix this so that each dash looks same. (I have tried this with 10x10 rectangle and got same result)

Well, I played with it a bit. It seems to be a “feature” of GDI+.

It seemed to happen a lot less (at different zoom levels) if I simply did:

mPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dot;

and didn’t specify a DashPattern.

But… this even may be something that is different on different graphic accelerators.