Geometry.Transform Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Property Value
The transformation applied to the Geometry. Note that this value may be a single Transform or a TransformCollection cast as a Transform.
Examples
The following example shows how to use the Transform property to apply a RotateTransform to a Geometry object.
The 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>
Remarks
This method returns the identity transformation if the current object has no transformation value. Otherwise, it returns the Transform applied to the current object.
Dependency Property Information
Identifier field | TransformProperty |
Metadata properties set to true |
None |
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기