Share via


How to: Animate an Embossed Visual Effect

This topic explains how to animate properties of an embossed visual effect.

Example

The following example animates the LightAngle property of an EmbossBitmapEffect such that the shadowing effects resulting from the "light" positioning will shift over the embossed edge of the image.

<Page xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml" >

  <StackPanel>

    <Image Source="/images/WaterLilies.jpg" Width="600"  Margin="10" >
      <Image.BitmapEffect>
        <EmbossBitmapEffect x:Name="myEmbossBitmapEffect"  Relief="0.8" LightAngle="0" />
      </Image.BitmapEffect>
      <Image.Triggers>
        <EventTrigger RoutedEvent="Image.Loaded">
          <BeginStoryboard>
            <Storyboard>

              <!-- Animate the LightAngle so that the artificial light
                   orbits around the embossed image which makes the
                   shadows cast by the emboss shift accordingly. -->
              <DoubleAnimation
               Storyboard.TargetName="myEmbossBitmapEffect"
               Storyboard.TargetProperty="LightAngle"
               From="0" To="360" Duration="0:0:3" />

            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Image.Triggers>
    </Image>

  </StackPanel>

</Page>

For the complete sample, see Bitmap Effects Gallery Sample.

See Also

Tasks

How to: Create an Embossed Visual Effect

How to: Animate Multiple Visual Effects

Bitmap Effects Gallery Sample

Concepts

Bitmap Effects Overview

Reference

LightAngle

EmbossBitmapEffect

BitmapEffect

Other Resources

Bitmap Effects How-to Topics

Bitmap Effects Samples