次の方法で共有


方法 : ぼかし視覚効果をアニメーション化する

更新 : 2007 年 11 月

BlurBitmapEffectRadius プロパティをアニメーション化し、Button をクリックすると、それがぼやけるようにする方法を次の例に示します。

使用例

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

  <StackPanel>

    <Button  Width="200">
      Click to Blur ME!
      <Button.BitmapEffect>

        <!-- This BitmapEffect is targeted by the animation. -->
        <BlurBitmapEffect x:Name="myBlurBitmapEffect"  Radius="0" />

      </Button.BitmapEffect>
      <Button.Triggers>
        <EventTrigger RoutedEvent="Button.Click">
          <BeginStoryboard>
            <Storyboard>

              <!-- Blur the Button and then animate back to normal. -->
              <DoubleAnimation
               Storyboard.TargetName="myBlurBitmapEffect"
               Storyboard.TargetProperty="Radius"
               From="0" To="40" Duration="0:0:0.3"
               AutoReverse="True" />
            </Storyboard>
          </BeginStoryboard>
        </EventTrigger>
      </Button.Triggers>
    </Button>

  </StackPanel>

</Page>

参照

処理手順

方法 : ビジュアルにぼかし効果を適用する

方法 : グロー効果をアニメーション化する

方法 : ドロップ シャドウ視覚効果をアニメーション化する

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