1

I'm trying to see if someone can shed some light in helping me create a Zune style Silverlight animation.

I want to recreate an effect just like the Zune Artist Background when the song is playing. I have figured out the Ken Burns style motion and zoom effect for the image, but I can't figure out how I can overlay the base image with a color and then animate the color. I used the WriteableBitmapExtensions and added a colored rectangle overlay but I don't understand how I can animate that to change the color with time.

Does someone have an idea on how I can do so? I would love to hear some ideas.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Anup Marwadi
  • 2,517
  • 4
  • 25
  • 42

1 Answers1

0

You should animate the color of the rectangle overlay with a storyboard. Here is an example that animates on mouse events:

<Canvas.Resources>
  <Storyboard x:Name="mouseEnter">
    <ColorAnimation
       Duration='00:00:01'
       To='#000000'
       Storyboard.TargetName='myRectangle'
       Storyboard.TargetProperty='(Shape.Fill).(SolidColorBrush.Color)' />
  </Storyboard>
  <Storyboard x:Name='mouseLeave'>
    <ColorAnimation
       Duration='00:00:01'
       To='#FF0000'
       Storyboard.TargetName='myRectangle'
       Storyboard.TargetProperty='(Shape.Fill).(SolidColorBrush.Color)' />
  </Storyboard>
</Canvas.Resources>

The WriteableBitmap is IMHO not suitable for your use case.

thumbmunkeys
  • 20,606
  • 8
  • 62
  • 110