剪辑倒转自己的几何 [英] Clip inverted own geometry

查看:159
本文介绍了剪辑倒转自己的几何的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循增加StrokeThickness但保持Path的维度,是吗?有可能做相反的事情吗?只保留外部中风。有没有一种方法可以排除自我几何?

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

推荐答案

您也可以通过自己的几何体裁剪路径,但使用 CombinedGeometry 具有足够大的外部RectangleGeometry和由路径 Data 提供的排除的内部几何图形:

You may also clip the Path by its own geometry, but use a CombinedGeometry with a large enough outer RectangleGeometry and an excluded inner geometry, provided by the Path's 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 may perhaps draw a second, filled Path with the same geometry on top of the first one. You need to make sure both are aligned identically.

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

这篇关于剪辑倒转自己的几何的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆