日期:2014-05-17  浏览次数:20778 次

wpf图片动画的问题
打个比方就如同QQ的最小化按钮那样  鼠标移动上去和移出的效果
这应该是两张图  举例来说正常是A图  鼠标移动上去B图渐入  鼠标移出B图渐出
这个图片的渐入渐出怎么实现呢?

我现在的代码上面的关闭按钮的样式
 <!--关闭按钮样式-->
    <Style x:Key="closeBtnStyle" TargetType="Button">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">

                    <Image Name="closeBtn" Source="/images/sysbtn_close_normal.png"  Height="29" />
                    
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsMouseOver" Value="True">
                            <Setter Property="Source" Value="/images/sysbtn_close_hover.png" TargetName="closeBtn" />
                        </Trigger>
                        <Trigger Property="IsPressed" Value="True">
                            <Setter Property="Source" Value="/images/sysbtn_close_down.png" TargetName="closeBtn" />

                        </Trigger>
                     
                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>