Hi, Syed,
I think this issue is not related to the Scaling, but the drawing process of Pen.
When you are drawing a rectangle with Pen object,
it draws 4 lines clockwiseas a matter of fact.
And if the last dash of one side is too long,
it will be trimmed and continued in next side.
For example,
Code Block
private void Form1_Paint(object sender, PaintEventArgs e)
{
Pen pen = new Pen(Brushes.Red,2);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash; e.Graphics.ScaleTransform(5, 5); pen.ScaleTransform(1f / 5f, 1f / 5f); e.Graphics.DrawRectangle(pen, 10, 10, 36, 36);
}
Code Block
private void Form1_Paint(object sender, PaintEventArgs e)
{
Pen pen = new Pen(Brushes.Red,2);
pen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
pen.DashPattern = new float[2] { 2.5f, 2f };//2.5 for dash, 2 for blank
e.Graphics.ScaleTransform(5, 5);
pen.ScaleTransform(1f / 5f, 1f / 5f);
e.Graphics.DrawRectangle(pen, 10, 10, 36, 36);
}
http://msdn2.microsoft.com/en-us/library/system.drawing.pen.dashpattern.aspx
Hope this helps,
Regards