Geometry.Transform 屬性

定義

取得或設定套用至 TransformGeometry 物件。

public:
 property System::Windows::Media::Transform ^ Transform { System::Windows::Media::Transform ^ get(); void set(System::Windows::Media::Transform ^ value); };
public System.Windows.Media.Transform Transform { get; set; }
member this.Transform : System.Windows.Media.Transform with get, set
Public Property Transform As Transform

屬性值

Transform

套用至 Geometry 的轉換。 請注意,這個值可能是單一 Transform 或是做為某個 TransformCollectionTransform 轉換。

範例

下列範例示範如何使用 Transform 屬性將 套用 RotateTransformGeometry 物件。

此範例使用 GeometryGroup 從三 Geometry 個物件建立複合圖形,然後使用 屬性旋轉幾何 45 度 Transform

<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  <Canvas>

    <!-- Displays the geometry. -->
    <Path Stroke="Black" StrokeThickness="1" Fill="#CCCCFF">
      <Path.Data>

        <!-- Creates a composite shape from three geometries. -->
        <GeometryGroup FillRule="EvenOdd">
          <LineGeometry StartPoint="10,10" EndPoint="50,30" />
          <EllipseGeometry Center="40,70" RadiusX="30" RadiusY="30" />
          <RectangleGeometry Rect="30,55 100 30" />

          <!-- Rotate the geometry 45 degrees using the Transform Property. -->
          <GeometryGroup.Transform>
            <RotateTransform CenterX="40" CenterY="70" Angle="45" />
          </GeometryGroup.Transform>
        </GeometryGroup>
      </Path.Data>
    </Path>

  </Canvas>
</Page>

備註

如果目前物件沒有轉換值,這個方法會傳回識別轉換。 否則,它會傳 Transform 回套用至目前 物件的 。

相依性屬性資訊

識別碼欄位 TransformProperty
中繼資料屬性設定為 true

適用於