|
[C#]
using (Bitmap bm = new Bitmap(600, 600)) {
using (Graphics graphics = Graphics.FromImage(bm)) {
RectangleF rect = bm.Bounds;
rect.Inflate(-50, -50);
GraphicsPath arc = new GraphicsPath();
arc.AddArc(rect, 135, 270);
Pen pen = new Pen(Color.Green, 20);
pen.StartCap = LineCap.OpenArrowAnchor;
pen.EndCap = LineCap.OpenArrowAnchor;
graphics.DrawPath(pen, arc);
}
bm.Save(Server.MapPath("IG8_GraphicsPath_DrawPath.png"));
}
The code here draws an arc into a GraphicsPath. We then draw the
arc onto a Bitmap providing arrows at either end. The final output
is shown below.

IG8_GraphicsPath_DrawPath.png
|