This topic has not yet been rated - Rate this topic

SkewTransform class

Represents a two-dimensional skew.

Inheritance

Object
  DependencyObject
    GeneralTransform
      Transform
        SkewTransform

Syntax

Public NotInheritable Class SkewTransform  
    Inherits Transform

<SkewTransform .../>

Attributes

ActivatableAttribute(NTDDI_WIN8)
MarshalingBehaviorAttribute(Agile)
StaticAttribute(Windows.UI.Xaml.Media.ISkewTransformStatics, NTDDI_WIN8)
ThreadingAttribute(Both)
VersionAttribute(NTDDI_WIN8)
WebHostHiddenAttribute()

Members

The SkewTransform class has these types of members:

Constructors

The SkewTransform class has these constructors.

ConstructorDescription
SkewTransform Initializes a new instance of the SkewTransform class.

 

Methods

The SkewTransform 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 Transforms 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 SkewTransform class has these properties.

PropertyAccess typeDescription

AngleX

Read/writeGets or sets the x-axis skew angle, which is measured in degrees counterclockwise from the y-axis.

AngleXProperty

Read-onlyIdentifies the AngleX dependency property.

AngleY

Read/writeGets or sets the y-axis skew angle, which is measured in degrees counterclockwise from the x-axis.

AngleYProperty

Read-onlyIdentifies the AngleY dependency property.

CenterX

Read/writeGets or sets the x-coordinate of the transform center.

CenterXProperty

Read-onlyIdentifies the CenterX dependency property.

CenterY

Read/writeGets or sets the y-coordinate of the transform center.

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)

 

Examples

This example uses a SkewTransform to skew text. A skew, also known as a shear, is a transformation that stretches the coordinate space in a non-uniform manner. In this example, the two text strings are skewed -30 degrees and 30 degrees along the x-coordinate.


<Canvas Margin="30">
    <!-- Skew the text using a SkewTransform. -->
    <TextBlock FontSize="32"
               FontWeight="Bold" 
               Foreground="Maroon"
               Text="Skewed Text">
        <TextBlock.RenderTransform>
            <SkewTransform AngleX="-30" AngleY="0" />
        </TextBlock.RenderTransform>
    </TextBlock>

    <TextBlock Canvas.Top="60"
               FontSize="32"
               FontWeight="Bold" 
               Foreground="Maroon"
               Text="Skewed Text">
        <TextBlock.RenderTransform>
            <SkewTransform AngleX="30" AngleY="0" />
        </TextBlock.RenderTransform>
    </TextBlock>
</Canvas>


This next example shows how to increase the AngleX property value of a SkewTransform applied to a Rectangle every time the Rectangle is clicked.


<Rectangle PointerPressed="IncreaseSkew"
           Width="50" Height="50" 
           Fill="RoyalBlue">
    <Rectangle.RenderTransform>
        <!-- If you give the transform a name 
             you can access it easily from code. -->
        <SkewTransform x:Name="mySkewTransform" />
    </Rectangle.RenderTransform>
</Rectangle>



public void IncreaseSkew(object sender, RoutedEventArgs e)
{
    mySkewTransform.AngleX = mySkewTransform.AngleX + 5;
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Namespace

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

Metadata

Windows.winmd

See also

Transform
XAML two-dimensional transforms sample

 

 

Build date: 12/4/2012

© 2013 Microsoft. All rights reserved.