tags:

views:

52

answers:

0

I'm overriding OnPaint for a panel and drawing a circle with a radius slightly less than the shortest side of the panel. The radius changes when the panel resizes. The circle is rendered with Graphics.DrawArc, using a pen with a thickness of 10.0f.

This works fine when I use a solid color for my pen. However, I would like to give the arc a smooth gradient look, with a lighter color on the inside and a darker color on the outside. It seems that PathGradientBrush would be a good starting point, but I can't think of an efficient way to create the gradient. The best I can come up with is to define the brush's path to be as large as the circle.

Is there a better way to do this?