Animate RenderTransform Angle : Animation « 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.Date Time
8.Design Patterns
9.Development Class
10.Event
11.File Stream
12.Generics
13.GUI Windows Form
14.Internationalization I18N
15.Language Basics
16.LINQ
17.Network
18.Office
19.Reflection
20.Regular Expressions
21.Security
22.Services Event
23.Thread
24.Web Services
25.Windows
26.Windows Presentation Foundation
27.XML
28.XML LINQ
C# / C Sharp » Windows Presentation Foundation » AnimationScreenshots 
Animate RenderTransform Angle
Animate RenderTransform Angle
     
<Window x:Class="Animation.AnimateVisual"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="AnimateVisualBrush" Height="300" Width="300" Background="LightGoldenrodYellow">
    <Grid>
      <Grid.RowDefinitions>
        <RowDefinition></RowDefinition>
        <RowDefinition></RowDefinition>
      </Grid.RowDefinitions>

      <Button Name="visual" HorizontalAlignment="Center" VerticalAlignment="Center">
        <Button.Content>Test</Button.Content>
        <Button.Triggers>
          <EventTrigger RoutedEvent="Button.Click">
            <BeginStoryboard>
              <Storyboard  RepeatBehavior="Forever">
                <DoubleAnimation Storyboard.TargetName="rectangle"
                                 Storyboard.TargetProperty="RenderTransform.Children[0].AngleY"
                                 To="180" Duration="0:0:15" AutoReverse="True"></DoubleAnimation>
                <DoubleAnimation Storyboard.TargetName="rectangle"
                                 Storyboard.TargetProperty="RenderTransform.Children[1].Angle"
                                 To="180" Duration="0:0:20" AutoReverse="True"></DoubleAnimation>
              </Storyboard>
            </BeginStoryboard>
          </EventTrigger>
        </Button.Triggers>
      </Button>
      
      <Rectangle Grid.Row="1" Name="rectangle" Width="100" Stretch="Uniform" ClipToBounds="False" RenderTransformOrigin="0.5,0.5">
        <Rectangle.Fill>
          <VisualBrush Visual="{Binding ElementName=visual}">
           
          </VisualBrush>
        </Rectangle.Fill>
        <Rectangle.RenderTransform>
          
            <TransformGroup>
              <SkewTransform CenterX="0.5"></SkewTransform>
              <RotateTransform CenterX="0.5" CenterY="0.5"></RotateTransform>
            </TransformGroup>
          
        </Rectangle.RenderTransform>
      </Rectangle>
    </Grid>
  </Window>

   
    
    
    
    
  
Related examples in the same category
1.Two AnimationsTwo Animations
2.Bouncing BallBouncing Ball
3.Animation along a pathAnimation along a path
4.Animate RadialGradientAnimate RadialGradient
5.Animate OpacityAnimate Opacity
6.Animation In StyleAnimation In Style
7.Animation without acceleration or decelerationAnimation without acceleration or deceleration
8.Animation with a fast speedAnimation with a fast speed
9.Animation with a slow speedAnimation with a slow speed
10.Animation that accelerates through 50% of its durationAnimation that accelerates through 50% of its duration
11.Animation that decelerates through 50% of its durationAnimation that decelerates through 50% of its duration
12.Animate the brush's RadiusX property.Animate the brush's RadiusX property.
13.Animate Fill.RadiusYAnimate Fill.RadiusY
14.Animate GradientStop and Button controlAnimate GradientStop and Button control
15.Animate EndPointAnimate EndPoint
16.Animate StartPointAnimate StartPoint
17.Animate Ellipse RadiusY, RadiusXAnimate Ellipse RadiusY, RadiusX
18.XAML Only AnimationXAML Only Animation
19.Animation with Discrete Key FramesAnimation with Discrete Key Frames
20.Animation with Mixed Key Frames.xamlAnimation with Mixed Key Frames.xaml
21.Control Animations Through TriggersControl Animations Through Triggers
22.Animate the Color of a Brush with Indirect Property TargetingAnimate the Color of a Brush with Indirect Property Targeting
23.Animate the background colorAnimate the background color
24.Animate Width and Height of a EllipseAnimate Width and Height of a Ellipse
25.Animate Width and Height of a RectangleAnimate Width and Height of a Rectangle
26.Use ColorAnimationUsingKeyFrames to animate the foreground color of a TextBlockUse ColorAnimationUsingKeyFrames to animate the foreground color of a TextBlock
27.Use StringAnimationUsingKeyFrames to animate the text value of a TextBlockUse StringAnimationUsingKeyFrames to animate the text value of a TextBlock
28.Four Sided BounceFour Sided Bounce
29.Discrete Double Key FrameDiscrete Double Key Frame
30.Simple Path AnimationSimple Path Animation
31.Start the animation with Path is loadedStart the animation with Path is loaded
32.Matrix Animated ButtonMatrix Animated Button
33.Bouncing Ball with ParallelTimelineBouncing Ball with ParallelTimeline
34.Bouncing Ball with DoubleAnimationBouncing Ball with DoubleAnimation
35.KeySpline AnimationKeySpline Animation
36.Ball moves in a constant speedBall moves in a constant speed
37.Ball moves following spline key framesBall moves following spline key frames
38.Repetition countRepetition count
39.Repetition durationRepetition duration
40.Use ColorAnimationUsingKeyFrames to animate GradientStopUse ColorAnimationUsingKeyFrames to animate GradientStop
41.Use StringAnimationUsingKeyFrames to ColorUse StringAnimationUsingKeyFrames to Color
42.Using DiscreteStringKeyFrameUsing DiscreteStringKeyFrame
43.Animate Ball HeightAnimate Ball Height
44.Rotate Button AnimationRotate Button Animation
45.Rotate Button Animation With LayoutRotate Button Animation With Layout
46.A simple, finite animationA simple, finite animation
47.Code Animation Accelerate DecelerateCode Animation Accelerate Decelerate
48.Animation with codeAnimation with code
49.Velocity animationVelocity animation
50.Animation In CodeAnimation In Code
51.A Simple Animation in CodeA Simple Animation in Code
52.Remove Animations with AnimationClockRemove Animations with AnimationClock
53.Remove AnimationsRemove Animations
54.Control the Progress of an AnimationControl the Progress of an Animation
55.Markup for navigation transition animations
56.Opacity AnimationOpacity Animation
57.Width and Height animationWidth and Height animation
58.Timer triggered AnimationTimer triggered Animation
59.Path animation by code, duration, RepeatBehaviorPath animation by code, duration, RepeatBehavior
60.Rolling Ball AnimationRolling Ball Animation
61.Show a Continuous Animation During an Asynchronous ProcessShow a Continuous Animation During an Asynchronous Process
62.Receive Notification When an Animation CompletesReceive Notification When an Animation Completes
63.An animated Ellipse traces the outline of rendered text by using the path geometry of the text.An animated Ellipse traces the outline of rendered text by using the path geometry of the text.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.