Transform demo : Transform « Graphics « Silverlight






Transform demo

Transform demo
   

<UserControl x:Class='SilverlightApplication3.MainPage'
    xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' 
    xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
    xmlns:d='http://schemas.microsoft.com/expression/blend/2008' 
    xmlns:mc='http://schemas.openxmlformats.org/markup-compatibility/2006' 
    mc:Ignorable='d' 
    d:DesignWidth='640' 
    d:DesignHeight='480'>
    
    <Grid x:Name="LayoutRoot" Background="White">

        <TextBlock Text="Silverlight Rocks">
            <TextBlock.RenderTransform>
                <RotateTransform Angle="45" />
            </TextBlock.RenderTransform>    
        </TextBlock>


        <Canvas Background="White" >

            <Rectangle Fill="Black" 
                   Width="200" 
                   Height="30"
                   Canvas.Top="50"
                   Canvas.Left="50">
            </Rectangle>

            <Rectangle Fill="Black" 
                   Width="200" 
                   Height="30"
                   Canvas.Top="150"
                   Canvas.Left="50">
                <Rectangle.RenderTransform>
                    <SkewTransform AngleX="25" />
                </Rectangle.RenderTransform>
            </Rectangle>

            <Rectangle Fill="Black" 
                   Width="200" 
                   Height="30"
                   Canvas.Top="250"
                   Canvas.Left="50">
                <Rectangle.RenderTransform>
                    <SkewTransform AngleY="25" />
                </Rectangle.RenderTransform>
            </Rectangle>

            <Rectangle Fill="Black"
                   Width="200"
                   Height="30"
                   Canvas.Top="350"
                   Canvas.Left="50">
                <Rectangle.RenderTransform>
                    <SkewTransform AngleY="-25" />
                </Rectangle.RenderTransform>
            </Rectangle>
        </Canvas>

    </Grid>
    
</UserControl>

   
    
    
  








Related examples in the same category

1.Transforming an ObjectTransforming an Object
2.Translate transformTranslate transform
3.Scale transformScale transform
4.Combine Transforms with TransformGroupCombine Transforms with TransformGroup
5.Scale Transform, Rotate Transform in codeScale Transform, Rotate Transform in code