Transforming in WPF using VB.NET

In this article you will learn how to perform Transforming in WPF.
  • 1479
 

Transforming: The Transform class provides the means to transform shapes in a two-dimensional plane. To transform a shape, you assign the RenderTransform property to the transform object you want to use. Depending on the transform object you're using, you'll need to fill in different properties to configure it.

A common transform to apply to a shape is a rotation. To rotate a shape, create a RotateTransform and specify its Angle. An Angle of 45 rotates the element 45 degrees clockwise; an angle of 90 rotates the element 90 degrees clockwise; and so on.

Given below example of a TRansformGroup has been used here to combine the effects of two transforms. (Note that the rotation angle is specified in degrees here.)

Example

<Window x:Class="Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <StackPanel Orientation="Horizontal">
        <TextBlock>
        <TextBlock.RenderTransform>
            <TransformGroup
                <ScaleTransform ScaleX="2" ScaleY="2" />
                <RotateTransform Angle="10" />
            </TransformGroup>
        </TextBlock.RenderTransform>
        MANISH,
       
</TextBlock
        <TextBlock>Tewatia</TextBlock>
    </StackPanel>
</
Window>

Output window

trans1.gif
 

Conclusion

Hope this article help you to understand how to perform Transforming in WPF.

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.