GeometryCombineMode 列舉

定義

指定用來結合兩個幾何的不同方法。Specifies the different methods by which two geometries can be combined.

public enum class GeometryCombineMode
public enum GeometryCombineMode
type GeometryCombineMode = 
Public Enum GeometryCombineMode
繼承
GeometryCombineMode

欄位

Exclude 3

第二個區域不包含在第一個中。The second region is excluded from the first. 指定的兩個幾何 AB,其中幾何 B 的區域會從幾何 A 的區域中移除,產生一個 A-B 的區域。Given two geometries, A and B, the area of geometry B is removed from the area of geometry A, producing a region that is A-B.

Intersect 1

藉由取得兩個區域的交集來組合它們。The two regions are combined by taking their intersection. 新區域是由這兩個幾何的重疊區域所組成。The new area consists of the overlapping region between the two geometries.

Union 0

藉由取得兩個區域的聯集來組合它們。The two regions are combined by taking the union of both. 產生的幾何是由幾何 A + 幾何 B 所組成。The resulting geometry is geometry A + geometry B.

Xor 2

藉由取得第一個區域中存在但第二個區域中不存在的區域以及第二個區域中存在但第一個區域中不存在的區域,來組合這兩個區域。The two regions are combined by taking the area that exists in the first region but not the second and the area that exists in the second region but not the first. 新區域是由 (A-B) + (B-A) 所組成,其中 AB 都是幾何圖形。The new region consists of (A-B) + (B-A), where A and B are geometries.

範例

下列範例顯示如何使用聯集合並模式來結合兩個幾何。The following example shows how to combine two geometries using the Union combine mode.

<Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
  <Path.Data>
    
    <!-- Combines two geometries using the union combine mode. -->
    <CombinedGeometry GeometryCombineMode="Union">
      <CombinedGeometry.Geometry1>
        <EllipseGeometry RadiusX="50" RadiusY="50" Center="75,75" />
      </CombinedGeometry.Geometry1>
      <CombinedGeometry.Geometry2>
        <EllipseGeometry RadiusX="50" RadiusY="50" Center="125,75" />
      </CombinedGeometry.Geometry2>
    </CombinedGeometry>
  </Path.Data>
</Path>

備註

下圖顯示不同的 geometry 合併模式。The following illustration shows the different geometry combine modes.

套用至兩個幾何的不同合併模式Different combine modes applied to two geometries
幾何合併模式Geometry Combine Modes

適用於