Alex Rivera | Logout

Creating Gradient Brush along a Circular Path

Asked 2011-01-29T21:47:45.980
16

I need to create a multi-step gradient along a circular path, as demonstrated in the following image:

Wheel Gradient

Does anyone have any ideas on how this could be accomplished in XAML rather than code? Would it be possible to use the existing gradient brushes or composite them somehow to achieve this effect?

Edit
Report

1 Answer

1

In GDI+/Winforms you can use the PathGradientBrush to do this:

Unfortunately there is no support for a PathGradientBrush in WPF, but a few people have asked for it here:

http://dotnet.uservoice.com/forums/40583-wpf-feature-suggestions/suggestions/480949-add-a-pathgradientbrush-like-in-winforms-

(might be worth casting your vote too!)

Because of the lack of support you cannot do it directly in XAML, you could however use GDI+ code to create an image and then use the image in your XAML. This might give you better performance than using a non-affine transformation.

answered 2011-01-31T01:34:36.713

Your Answer