views:

65

answers:

2

I have this code for expanding and contracting images in a sexy manner. I'd like to add a little rotation in there, just to make the image pop up, you know?

Where/how do I add rotation animations to control?

<Style.Triggers>
                <EventTrigger RoutedEvent="Image.MouseEnter">
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation Duration="0:0:0.25" From="1" To="1.2" AutoReverse="True"
                                     Storyboard.TargetProperty="RenderTransform.ScaleX"/>
                            <DoubleAnimation Duration="0:0:0.1" From="1" To="1.2" AutoReverse="True" 
                                     Storyboard.TargetProperty="RenderTransform.ScaleY"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>             
</Style.Triggers>
+2  A: 

You need to set RenderTransform to a TransformGroup containing a RotateTransform and a ScaleTransform, then animate the RotateTransform's Angle property.

SLaks
Would you mind posting sample code, I've never used this before so I can't really begin learning it without an example.
Sergio Tapia
+1  A: 

Download Blend and use that. You can create storyboards and rotate you objects with that. It will generate all the XAML for you... you can learn that way

Coding animations kinda defeats the point of WPF

Schneider
Is this version free? I can download Blend 2 for free via my college membership, but 3 isn't available right now. Can Blend 2 do the same thing?
Sergio Tapia
yes, its the same thing. worst case just use the trial for 30 days... should be long enough to work out the xaml...
Schneider