Reputation: 7895
I'm trying to display a WPF Path
-Object with the following requirements:
Path
itself displayed in a specific color and a specific thickness.Path
with another color and thicknessExample (in real life the figure is more complex, with curves etc.):
Is there any way to achieve this effect in WPF?
I tried to overlay two separate Path (red Path on top of blue Path), but the result does not look very smooth, especially when you have rounded corners.
I also tried using a DropShadowEffect
, but couldn't get a clear outline like in the example.
Any idea?
Thanks!
Upvotes: 1
Views: 3693
Reputation: 128062
created by
<Canvas>
<Canvas.Resources>
<Geometry x:Key="pathData">M100,100 L200,100 200,150 A1,1 0 0 1 100,150 Z</Geometry>
</Canvas.Resources>
<Path Stroke="Blue" StrokeThickness="15" StrokeLineJoin="Round"
Data="{StaticResource pathData}"/>
<Path Stroke="Red" StrokeThickness="6" StrokeLineJoin="Round"
Data="{StaticResource pathData}"/>
</Canvas>
Upvotes: 10