Linear gradient on WPF PolyLine

I want to draw a polyline in WPF that has a different opacity between its beginning and end. I used LinearGradientBrush for this. However, this does not meet my expectations. The gradient takes into account the position in the bounding box or in the container. Is it possible to have a gradient based on the “length” (between the beginning and the end) of the polyline?

+4
source share
2 answers

Try Charles Petzold GradientPath . But this is a FrameworkElement , so you cannot use it in the same way as Polyline .

0
source

All Articles