次の方法で共有


方法 : エンボス視覚効果をアニメーション化する

更新 : 2007 年 11 月

このトピックでは、エンボス視角効果のプロパティをアニメーション化する方法について説明します。

使用例

"光" の位置によって発生するシャドウ効果がイメージのエンボスされた縁に沿って移動するように、EmbossBitmapEffectLightAngle プロパティをアニメーション化する例を次に示します。

<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>

サンプル全体については、「ビットマップ効果ギャラリーのサンプル」を参照してください。

参照

処理手順

方法 : エンボス視覚効果を作成する

方法 : 複数の視覚効果をアニメーション化する

ビットマップ効果ギャラリーのサンプル

概念

ビットマップ効果の概要

参照

LightAngle

EmbossBitmapEffect

BitmapEffect

その他の技術情報

ビットマップ効果に関する「方法」トピック

ビットマップ効果のサンプル