Clip flipped its own geometry

Following the Increase StrokeThickness, but maintaining the dimensions of the Path , is it possible to do the opposite? keeping only the outer stroke. Is there any way to exclude the geometry itself?

0
source share
1 answer

You can also copy the Path according to your geometry, but use CombinedGeometrywith a sufficiently large external RectangleGeometry and excluded internal geometry provided by Path Data:

<Path ...>
    <Path.Clip>
        <CombinedGeometry
            GeometryCombineMode="Exclude"
            Geometry2="{Binding Data, RelativeSource={RelativeSource AncestorType=Path}}">
            <CombinedGeometry.Geometry1>
                <RectangleGeometry Rect="-1000,-1000,2000,2000"/>
            </CombinedGeometry.Geometry1>
        </CombinedGeometry>
    </Path.Clip>
</Path>

Alternatively, you can draw a second filled Path with the same geometry on top of the first. You must make sure that they are both the same.

<Path x:Name="path" ...>
<Path Fill="White" Data="{Binding Data, ElementName=path}"/>
+1
source

All Articles