

Using the previous example, a value of Nonzero for FillRule gives the following illustration as a result:Īs you can see, all the rings are filled. After counting the crossings, if the result is zero then the point is outside the path. Starting with a count of zero, add one each time a Segment crosses the ray from left to right and subtract one each time a path segment crosses the ray from right to left. NonZero: This rule determines whether a point is in the fill region of the path by drawing a ray from that point to infinity in any direction and then examining the places where a segment of the shape crosses the ray. This is because a ray drawn from any point within either of those two rings passes through an even number of segments. In the previous illustration, notice that the center and third ring are not filled. The following illustration shows the shape created in the previous example. If this number is odd, the point is inside if even, the point is outside.įor example, the XAML below creates a composite shape made up of a series of concentric rings (target) with a FillRule set to EvenOdd.
#Filling shapes geometry how to#
The following sections will describe how to use these two rules.ĮvenOdd: This rule determines whether a point is in the fill region by drawing a ray from that point to infinity in any direction and counting the number of path segments within the given shape that the ray crosses. There are two possible values for FillRule: EvenOdd and Nonzero. The FillRule property of a GeometryGroup or a PathGeometry, specifies a "rule" which the composite shape uses to determine whether a given point is part of the geometry.
