The ScaleX and ScaleY properties of this ScaleTransform are each animated from 0 to 1 : RenderTransform « Windows Presentation Foundation « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Windows Presentation Foundation » RenderTransformScreenshots 
The ScaleX and ScaleY properties of this ScaleTransform are each animated from 0 to 1
The ScaleX and ScaleY properties of this ScaleTransform are each animated from 0 to 1
  
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  x:Class="Microsoft.Samples.Graphics.Transforms.AnimatedScaleTransformExample"
  WindowTitle="Animated ScaleTransform Example" 
  Background="White">
  
    <StackPanel Margin="10">
        <Canvas Width="250" Height="250">
          <Rectangle
            Height="50" Width="50" Fill="#CCCCCCFF" Stroke="Blue" StrokeThickness="2"
            Canvas.Left="100" Canvas.Top="100">
            <Rectangle.RenderTransform>
              <ScaleTransform x:Name="MyAnimatedScaleTransform" CenterX="25" CenterY="25" ScaleX="1" ScaleY="1" />
            </Rectangle.RenderTransform>
          </Rectangle>
          <Rectangle Height="50" Width="50" Stroke="#99000000"
            StrokeDashArray="4,1" StrokeThickness="2"
            Canvas.Left="100" Canvas.Top="100" />            
        </Canvas>
      <StackPanel Orientation="Horizontal" HorizontalAlignment="Center"
        Margin="10">
        <Button Name="startButton" Margin="0,0,2,0">Start</Button>
        <Button Name="stopButton">Stop</Button>
        <StackPanel.Triggers>
          <EventTrigger SourceName="startButton" RoutedEvent="Button.Click">
            <BeginStoryboard Name="myBeginStoryboard">
              <Storyboard>
                <DoubleAnimation 
                  Storyboard.TargetName="MyAnimatedScaleTransform" 
                  Storyboard.TargetProperty="ScaleX" 
                  From="0" To="3" Duration="0:0:2" />
                <DoubleAnimation 
                  Storyboard.TargetName="MyAnimatedScaleTransform" 
                  Storyboard.TargetProperty="ScaleY" 
                  From="0" To="3" Duration="0:0:2" />              
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
          <EventTrigger SourceName="stopButton" RoutedEvent="Button.Click">
            <StopStoryboard BeginStoryboardName="myBeginStoryboard" />
          </EventTrigger>          
        </StackPanel.Triggers>
      </StackPanel>  
    </StackPanel>
</Page>

   
    
  
Related examples in the same category
1.Rotate the text 90 degrees using a RotateTransformRotate the text 90 degrees using a RotateTransform
2.Skew the text using a TranslateTransformSkew the text using a TranslateTransform
3.Skew the text using a SkewTransformSkew the text using a SkewTransform
4.Scale the text using a ScaleTransformScale the text using a ScaleTransform
5.Scales a rectangle by 200% from a center of (0,0)
6.Scales a rectangle by 200% from a center of (25,25)
7.ScaleX: 0.5 /ScaleY: 0.5 /Center: (25,25)
8.Scales a rectangle by 200% from a center of (0.5,0.5)
9.ScaleX: 0.5 / ScaleY: 0.5 / RenderTransformOrigin: (0.25,0.25)ScaleX: 0.5 / ScaleY: 0.5 / RenderTransformOrigin: (0.25,0.25)
10.Applies a horizontal skew of 45 degrees from a center point of (0,0)Applies a horizontal skew of 45 degrees from a center point of (0,0)
11.Applies a horizontal skew of 45 degrees from a center point of (25,25)Applies a horizontal skew of 45 degrees from a center point of (25,25)
12.Applies a vertical skew of 45 degrees from a center point of (25,25)Applies a vertical skew of 45 degrees from a center point of (25,25)
13.SkewTransform AngleX: 45 / AngleY: 0 / RenderTransformOrigin: (0.5,0.5)SkewTransform AngleX: 45 / AngleY: 0 / RenderTransformOrigin: (0.5,0.5)
14.TranslateTransform X: 50 / Y: 0
15.TranslateTransform X: 0 / Y : 50TranslateTransform X: 0 / Y : 50
16.TranslateTransform X: 50 / Y: 50TranslateTransform X: 50 / Y: 50
17.The X and Y properties of this TranslateTransform are each animated from -50 to 50The X and Y properties of this TranslateTransform are each animated from -50 to 50
18.Rotate then TranslateRotate then Translate
19.Translate then RotateTranslate then Rotate
20.Animated ScaleTransformAnimated ScaleTransform
21.Animated SkewTransform ExampleAnimated SkewTransform Example
22.Path with ScaleTransformationPath with ScaleTransformation
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.