Rotate and Scale rectangle as per user control
问题 I have UserControl of Size 300*200. and rectangle of size 300*200. graphics.DrawRectangle(Pens.Black, 0, 0, 300, 200); When I rotate rectangle in userControl by 30 degree, I get rotated rectangle but it is outsized. PointF center = new PointF(150,100); graphics.FillRectangle(Brushes.Black, center.X, center.Y, 2, 2); // draw center point. using (Matrix matrix = new Matrix()) { matrix.RotateAt(30, center); graphics.Transform = matrix; graphics.DrawRectangle(Pens.Black, 0, 0, 300, 200); graphics