12,064,812 members (40,785 online)
Rate this:
See more:
Hi,

There is no problem to draw an arc when bound rectangle is not rotated.

```Path.AddArc( Center.getX(), Center.getY(), Radius, Radius, startAngle, sweepAngle );
```

But when the rectangle is rotated with an angle, the arc will be wrong.

How can I correctly using it?

Thanks,
Posted 22-Dec-10 23:20pm
transoft2.5K
Edited 22-Dec-10 23:34pm
v3

Rate this:

## Solution 1

They do not need to worry about a rotation because all transformation will be added after the path creating:

```// Create a RoundedRectangle:
GraphicsPath path = RoundedRectangle.Create(20, 20, 100, 100, 15);

// Draw the created RoundedRectangle:
e.Graphics.FillPath(Brushes.Blue, path);

// Rotate it clockwise 45 degrees about its center:
Matrix matrix = new Matrix();
matrix.RotateAt(45, new Point(70,70));
path.Transform(matrix);

// Draw the rotated RoundedRectangle:
e.Graphics.FillPath(Brushes.Blue, path);
```

Top Experts
Last 24hrsThis month
 d@nish 200 CPallini 130 CHill60 120 RDBurmon 100 OriginalGriff 95
 Dave Kreskowiak 1,857 Richard MacCutchan 1,250 d@nish 980 OriginalGriff 909 CPallini 790