2

I want to clip a Grid by a dynamic PathGeometry and it's PathFigure.

In WPF application UIElement.Clip has some properties like CombinedGeometry,PathGeometry ... But in UWP there's only RectangleGeometry.

I'm very new to .Net and stuck on this right now, does anyone know the equivalent way in UWP?

Thanks.

meobeo173
  • 617
  • 1
  • 7
  • 20

1 Answers1

0

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

According to 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.

As @Jerry pointed out in this answer,

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

Community
  • 1
  • 1
terry
  • 1,569
  • 11
  • 19