CompositeTransform class

Applies to Windows and Windows Phone

Applies multiple transform operations to an object.

Inheritance

Object
  DependencyObject
    GeneralTransform
      Transform
        CompositeTransform

Syntax


public sealed class CompositeTransform : Transform


<CompositeTransform .../>

Attributes

[MarshalingBehavior(Agile)]
[Threading(Both)]
[Version(0x06020000)]
[WebHostHidden()]

Members

The CompositeTransform class has these types of members:

Constructors

The CompositeTransform class has these constructors.

ConstructorDescription
CompositeTransform Initializes a new instance of the CompositeTransform class.

 

Methods

The CompositeTransform class has these methods. It also inherits methods from the Object class.

MethodDescription
ClearValue Clears the local value of a dependency property. (Inherited from DependencyObject)
GetAnimationBaseValue Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)
GetValue Returns the current effective value of a dependency property from a DependencyObject. (Inherited from DependencyObject)
ReadLocalValue Returns the local value of a dependency property, if a local value is set. (Inherited from DependencyObject)
SetValue Sets the local value of a dependency property on a DependencyObject. (Inherited from DependencyObject)
TransformBounds Transforms the specified bounding box and returns an axis-aligned bounding box that is exactly large enough to contain it. (Inherited from GeneralTransform)
TransformBoundsCore Provides the means to override the TransformBounds behavior in a derived transform class. (Inherited from GeneralTransform)
TransformPoint Uses this transformation object's logic to transform the specified point, and returns the result. (Inherited from GeneralTransform)
TryTransform Attempts to transform the specified point and returns a value that indicates whether the transformation was successful. (Inherited from GeneralTransform)
TryTransformCore Provides the means to override the TryTransform behavior in a derived transform class. (Inherited from GeneralTransform)

 

Properties

The CompositeTransform class has these properties.

PropertyAccess typeDescription

CenterX

Read/writeGets or sets the x-coordinate of the center point for all transforms specified by the CompositeTransform.

CenterXProperty

Read-onlyIdentifies the CenterX dependency property.

CenterY

Read/writeGets or sets the y-coordinate of the center point for all transforms specified by the CompositeTransform.

CenterYProperty

Read-onlyIdentifies the CenterY dependency property.

Dispatcher

Read-onlyGets the CoreDispatcher that this object is associated with. (Inherited from DependencyObject)

Inverse

Read-onlyGets the inverse transformation of this GeneralTransform, if possible. (Inherited from GeneralTransform)

InverseCore

Read-onlyImplements the behavior for return value of Inverse in a derived or custom GeneralTransform. (Inherited from GeneralTransform)

Rotation

Read/writeGets or sets the angle, in degrees, of clockwise rotation.

RotationProperty

Read-onlyIdentifies the Rotation dependency property.

ScaleX

Read/writeGets or sets the x-axis scale factor. You can use this property to stretch or shrink an object horizontally.

ScaleXProperty

Read-onlyIdentifies the ScaleX dependency property.

ScaleY

Read/writeGets or sets the y-axis scale factor. You can use this property to stretch or shrink an object vertically.

ScaleYProperty

Read-onlyIdentifies the ScaleY dependency property.

SkewX

Read/writeGets or sets the x-axis skew angle, which is measured in degrees counterclockwise from the y-axis. A skew transform can be useful for creating the illusion of three-dimensional depth in a two-dimensional object.

SkewXProperty

Read-onlyIdentifies the SkewX dependency property.

SkewY

Read/writeGets or sets the y-axis skew angle, which is measured in degrees counterclockwise from the x-axis. A skew transform can be useful for creating the illusion of three-dimensional depth in a two-dimensional object.

SkewYProperty

Read-onlyIdentifies the SkewY dependency property.

TranslateX

Read/writeGets or sets the distance to translate along the x-axis.

TranslateXProperty

Read-onlyIdentifies the TranslateX dependency property.

TranslateY

Read/writeGets or sets the distance to translate (move) an object along the y-axis.

TranslateYProperty

Read-onlyIdentifies the TranslateY dependency property.

 

Remarks

CompositeTransform applies multiple transforms in this order:

  1. Scale (ScaleX, ScaleY )
  2. Skew (SkewX, SkewY)
  3. Rotate (Rotation)
  4. Translate (TranslateX, TranslateY)

If you want to apply multiple transforms to an object in a different order, you can create a TransformGroup and insert the transforms in your intended order.

CompositeTransform uses the same center point (CenterX, CenterY) for all transformations. If you want to specify different center points per transform, use TransformGroup.

Examples

This example shows how to apply the same transforms to an object by using either a CompositeTransform or a TransformGroup.


<StackPanel Margin="50">
    <Canvas Background="Black" Width="200" Height="200">
        <Rectangle Height="100" Width="100" Fill="Red">
            <Rectangle.RenderTransform>

                <!-- This one line of markup is the equivalent of the entire
             TransformGroup block in the other Canvas below. -->
                <CompositeTransform SkewX="30" Rotation="45" ScaleX="0.8" ScaleY="0.8" />
            </Rectangle.RenderTransform>
        </Rectangle>
    </Canvas>

    <Canvas Margin="10" Background="Black" Width="200" Height="200">
        <Rectangle Height="100" Width="100" Fill="Red">
            <Rectangle.RenderTransform>
                <TransformGroup>

                    <!-- Note that you have to apply these transforms in 
                     a specific order to get the same effect as the
                     CompositeTransform. -->
                    <ScaleTransform ScaleX="0.8" ScaleY="0.8" />
                    <SkewTransform AngleX="30" />
                    <RotateTransform Angle="45" />
                </TransformGroup>
            </Rectangle.RenderTransform>
        </Rectangle>
    </Canvas>
</StackPanel>


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Media
Windows::UI::Xaml::Media [C++]

Metadata

Windows.winmd

See also

Transform
XAML two-dimensional transforms sample
TransformGroup

 

 

Show:
© 2014 Microsoft