# 方法: 結合したジオメトリを作成するHow to: Create a Combined Geometry

この例では、ジオメトリを結合する方法を示します。This example shows how to combine geometries. 2 つのジオメトリを結合するを使用して、CombinedGeometryオブジェクト。To combine two geometries, use a CombinedGeometry object. 設定のGeometry1Geometry2結合、および設定する 2 つのジオメトリとプロパティ、 GeometryCombineMode 、ジオメトリをまとめて結合が方法を決定するプロパティをUnionIntersectExclude、またはXor.Set its Geometry1 and Geometry2 properties with the two geometries to combine, and set the GeometryCombineMode property, which determines how the geometries will be combined together, to Union, Intersect, Exclude, or Xor.

2 つ以上のジオメトリから複合ジオメトリを作成するには、使用、GeometryGroupします。To create a composite geometry from two or more geometries, use a GeometryGroup.

## 例Example

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
<Path.Data>

<!-- Combines two geometries using the exclude combine mode. -->
<CombinedGeometry GeometryCombineMode="Exclude">
<CombinedGeometry.Geometry1>
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Path.Data>
</Path>

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
<Path.Data>

<!-- Combines two geometries using the intersect combine mode. -->
<CombinedGeometry GeometryCombineMode="Intersect">
<CombinedGeometry.Geometry1>
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Path.Data>
</Path>

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
<Path.Data>

<!-- Combines two geometries using the union combine mode. -->
<CombinedGeometry GeometryCombineMode="Union">
<CombinedGeometry.Geometry1>
</CombinedGeometry.Geometry1>
<CombinedGeometry.Geometry2>
</CombinedGeometry.Geometry2>
</CombinedGeometry>
</Path.Data>
</Path>

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
<Path.Data>

<!-- Combines two geometries using the XOR combine mode. -->
<CombinedGeometry GeometryCombineMode="Xor">
<CombinedGeometry.Geometry1>