Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Geometry.Transform Property

Gets or sets the Transform object applied to a Geometry.

Namespace: System.Windows.Media
Assembly: PresentationCore (in presentationcore.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public Transform Transform { get; set; }
/** @property */
public Transform get_Transform ()

/** @property */
public void set_Transform (Transform value)

public function get Transform () : Transform

public function set Transform (value : Transform)

For XAML information, see the Transform type.

Property Value

The transformation applied to the Geometry. Note that this value may be a single Transform or a TransformCollection cast as a Transform.

Identifier field

TransformProperty

Metadata properties set to true

None

This method returns the identity transformation if the current object has no transformation value. Otherwise, it returns the Transform applied to the current object.

This example shows how to use the Transform property to apply a RotateTransform to a Geometry object.

The following example uses a GeometryGroup to create a composite shape from three Geometry objects and then rotates the geometry 45 degrees by using the Transform property.

<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>

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

Show:
© 2015 Microsoft