System.Windows.Media Namesp ...


.NET Framework Class Library for Silverlight
SkewTransform Class

Represents a two-dimensional skew.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)
Syntax

Visual Basic (Declaration)
Public NotInheritable Class SkewTransform _
    Inherits Transform
Visual Basic (Usage)
Dim instance As SkewTransform
C#
public sealed class SkewTransform : Transform
XAML Object Element Usage
<SkewTransform .../>
Remarks

A SkewTransform is useful for creating the illusion of three-dimensional depth in a two-dimensional object.

The local origin 0,0 for an object can be offset on a Canvas using Canvas..::.Left and Canvas..::.Top, but this does not count as a transform; the object retains its own local 0,0 in this case for transformation purposes.

Multiple transforms can be applied with a TransformGroup. Custom transforms can be created with a MatrixTransform.

The following illustration shows three examples of a SkewTransform applied to a Rectangle.

TextBlock using a SkewTransform

ms635527.JOLT_local_-909314876_img_wcpsdk_graphicsmm_skewtransformexample(en-us,VS.95).png

Transforms can alter the display of text in your application to create a decorative effect. The following illustration shows text skewed along the x-axis.

Text skewed along the x-axis

ms635527.JOLT_transformedtext03(en-us,VS.95).png
NoteNote:

A typeface can simulate an italic style by shearing, or skewing, a glyph. However, a non-simulated italic typeface is typically designed to have a better visual appearance than a simulated italic typeface.

Examples

The following 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.

Run this sample

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

Run this sample

XAML
    <Rectangle MouseLeftButtonDown="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>
Inheritance Hierarchy

System..::.Object
  System.Windows..::.DependencyObject
    System.Windows.Media..::.GeneralTransform
      System.Windows.Media..::.Transform
        System.Windows.Media..::.SkewTransform
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources

Tags :


Page view tracker