12,293,884 members (58,719 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
Edited 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
 Dave Kreskowiak 584 OriginalGriff 500 Richard MacCutchan 395 ppolymorphe 355 CHill60 350
 OriginalGriff 8,585 ppolymorphe 5,337 CHill60 5,250 KARTHIK Bangalore 4,482 Sergey Alexandrovich Kryukov 4,476