gpt4 book ai didi

c# - 如何在 UWP 中通过 PathGeometry 进行裁剪?

转载 作者:太空宇宙 更新时间:2023-11-03 15:29:58 25 4
gpt4 key购买 nike

我想通过动态 PathGeometry 和它的 PathFigure 来剪辑网格。

在 WPF 应用程序中,UIElement.Clip 具有一些属性,例如 CombinedGeometry、PathGeometry ...,但在 UWP 中只有 RectangleGeometry。

我是 .Net 的新手,现在坚持这个,有人知道 UWP 中的等效方法吗?

谢谢。

最佳答案

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.clip

根据 MSDN,

Remarks

The clipping geometry for UIElement.Clip in the Windows Runtime API must be a RectangleGeometry. You can't specify a non-rectangular geometry, as is permitted in some XAML frameworks like Microsoft Silverlight. The clipped area is the "outside" of the geometry. In other words, the content that is shown (not clipped) is the area of the rectangle that is drawn with Fill if the geometry were used as data for a Path rather than for clipping. The clipped area is any area that falls outside the rectangle. The clipped area isn't hit-testable.

作为@Jerrythis answer 中指出,

you can apply a Transform to a RectangleGeometry which gives you a little more insofar as options.

关于c# - 如何在 UWP 中通过 PathGeometry 进行裁剪?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34132083/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com