方法 : エンボス視覚効果をアニメーション化する
更新 : 2007 年 11 月
このトピックでは、エンボス視角効果のプロパティをアニメーション化する方法について説明します。
使用例
"光" の位置によって発生するシャドウ効果がイメージのエンボスされた縁に沿って移動するように、EmbossBitmapEffect の LightAngle プロパティをアニメーション化する例を次に示します。
<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>
サンプル全体については、「ビットマップ効果ギャラリーのサンプル」を参照してください。