Greg,

Can you use the Timeline.AutoReverse property?

MICHAEL KING

From: [email protected] [mailto:[email protected]] On 
Behalf Of Greg Keogh
Sent: Thursday, 7 July 2011 1:54 PM
To: 'ozDotNet'
Subject: WPF Setting ScaleTransform values

I have an animation that zooms a logo image into view. The Storyboard (not 
shown) begins and animates the Angle, ScaleX and ScaleY values creating a nice 
spin and zoom-out effect. The trouble is, I can't set the Scale values back to 
0.0 again so that the image is hidden and the animation is ready to being 
again. The control is defined like this:

<Image x:Name="imgWatermark" Width="500" Height="375">
  <Image.RenderTransform>
    <TransformGroup>
      <RotateTransform Angle="0" CenterX="250" CenterY="187" />
      <ScaleTransform CenterX="250" CenterY="187" ScaleX="0.0" ScaleY="0.0"/>
    </TransformGroup>
  </Image.RenderTransform>
</Image>

Later I do this to "hide" the image again ready for another zoom out.

ScaleTransform st = ((TransformGroup)imgWatermark.RenderTransform).Children[1] 
as ScaleTransform;
st.ScaleX = 0.0;
st.ScaleY = 0.0;

However, this code results in no visible effect. What trick am I missing?

Greg



Reply via email to