Transformation is one of the important feature that is introduced with WPF.
Transformation allows to map element from one co-ordinate space to another coordinate space. The transformation is mapped using Transformation Matrix in 2D space. By manipulating the matrix values you can Transform elements to Rotate, Scale, Skew and Translate.
Transformation are of 4 basic types :
1. RotateTranform : Rotates an element by a specified Angle. You can specify the Angle of Rotation and the element will be rotated in 2D space.
2. ScaleTransform : ScaleTransform allows you to scale the element means increase/decrease the size of the element in the 2D space.
3. SkewTransform : It skews the element by specified angle. Skew stretches elements in a NonUniform manner and thus the element will be transformed so
as in 3D space.
4. TranslateTransform : This transformation will make the element move by a specified X and Y Co-Ordinates.
There is also a provision to apply more than one Transformation using TransformGroup or MatrixTransform. TransformGroup allows you to specify more than
one Transformation to be applied on the single element and thus gives you a hybrid Transformation for your control.
                               
<TextBlock FontWeight="Bold" FontSize="20" Text="This is Text" Margin="20">
<TextBlock.RenderTransform>
<TransformGroup>
<RotateTransform Angle="20" />
<SkewTransform AngleX="10" AngleY="10" />
<TranslateTransform X="15" Y="19"/>
<ScaleTransform ScaleX="2" ScaleY="1" />
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>
Transformation allows to map element from one co-ordinate space to another coordinate space. The transformation is mapped using Transformation Matrix in 2D space. By manipulating the matrix values you can Transform elements to Rotate, Scale, Skew and Translate.
Transformation are of 4 basic types :
1. RotateTranform : Rotates an element by a specified Angle. You can specify the Angle of Rotation and the element will be rotated in 2D space.
2. ScaleTransform : ScaleTransform allows you to scale the element means increase/decrease the size of the element in the 2D space.
3. SkewTransform : It skews the element by specified angle. Skew stretches elements in a NonUniform manner and thus the element will be transformed so
as in 3D space.
4. TranslateTransform : This transformation will make the element move by a specified X and Y Co-Ordinates.
There is also a provision to apply more than one Transformation using TransformGroup or MatrixTransform. TransformGroup allows you to specify more than
one Transformation to be applied on the single element and thus gives you a hybrid Transformation for your control.
<TextBlock FontWeight="Bold" FontSize="20" Text="This is Text" Margin="20">
<TextBlock.RenderTransform>
<TransformGroup>
<RotateTransform Angle="20" />
<SkewTransform AngleX="10" AngleY="10" />
<TranslateTransform X="15" Y="19"/>
<ScaleTransform ScaleX="2" ScaleY="1" />
</TransformGroup>
</TextBlock.RenderTransform>
</TextBlock>


 
No comments:
Post a Comment