13,000,017 members (50,669 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 22:20pm
transoft2.5K
Updated 22-Dec-10 22: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
 RickZeeland 125 Michael_Davies 40 Jochen Arndt 30 Sergey Alexandrovich Kryukov 25 George Swan 25
 OriginalGriff 4,557 ppolymorphe 2,292 RickZeeland 2,162 Kornfeld Eliyahu Peter 1,973 Richard Deeming 1,593