在CodeBehind中逐渐更改图像不透明度

时间:2018-12-22 04:14:30

标签: image xaml opacity fade

按下按钮后,如何使图像在XAML中逐渐消失? 我尝试过这样的事情:

private void Button_2_Click(object sender, RoutedEventArgs e)
{

    for (int i = 0; i<120; i++)
    {
     newBackgroundBrushImage.Opacity = 0.2;
    }
}

但是,当然,这并非易事,因为最终结果是图像的不透明度仅改变了一次。enter image description here

0 个答案:

没有答案
相关问题