In what way CombinedGeometry is used ?

Platform: WPF| Category : 2D Graphics, Visual Layer

CombinedGeometry is used to combine two geometries. By updating the GeometryCombineMode property, along with Union, Intersect, Exclude and Xor options, we can achieve CombinedGeometry. This can be done with the following code snippets.

[XAML]
<Path Stroke="Black" StrokeThickness="1" Fill="Blue">
    <Path.Data>
        <CombinedGeometry GeometryCombineMode="Xor">
            <CombinedGeometry.Geometry1>
                <EllipseGeometry RadiusX="70" RadiusY="40" Center="50,50" />
            </CombinedGeometry.Geometry1>
            <CombinedGeometry.Geometry2>
                <EllipseGeometry RadiusX="50" RadiusY="30" Center="50,50" />
            </CombinedGeometry.Geometry2>
        </CombinedGeometry>
    </Path.Data>
</Path>

Reference link: https://docs.microsoft.com/en-us/dotnet/framework/wpf/graphics-multimedia/how-to-create-a-combined-geometry

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.