zoukankan      html  css  js  c++  java
  • Silverlight学习笔记2 纹理模糊

      直接进入主题:

            BlurEffect   使目标纹理模糊的位图效果

      首先我们得using 一下:   using System.Windows.Media.Effects;

      给button一个Click事件  方法如下

    代码
    private void OnClickBlurButton(object sender, RoutedEventArgs args)
    {
        
    // Toggle effect
        if (((Button)sender).Effect != null)
        {
            ((Button)sender).Effect 
    = null;
        }
        
    else
        {
            
    // Get a reference to the Button.
            Button myButton = (Button)sender;
          
            
    // Initialize a new BlurEffect that will be applied
            
    // to the Button.
            BlurEffect myBlurEffect = new BlurEffect();

            
    // Set the Radius property of the blur. This determines how 
            
    // blurry the effect will be. The larger the radius, the more
            
    // blurring. 
            myBlurEffect.Radius = 10;
            
             ss.Effect
    =myBlurEffect;//说明 ss我放入的一个图片name

            
    // Apply the effect to the Button.
            myButton.Effect = myBlurEffect;
        }
    }

     显示效果

    算了 网速太卡。。。不上传效果了 。。。自己学习中

  • 相关阅读:
    windows server 2008 r2 切换windows 7主题方法
    JAVA环境安装
    Oracle 11gR2 安装教学
    webmin-1.810 安装
    Windows Squid 安装配置
    Zyxel Switch-How to block a fake DHCP server without enabling DHCP snooping?
    Java介绍
    cookies和session区别
    牛刀小试之Django二
    小试牛刀之Django
  • 原文地址:https://www.cnblogs.com/blueSkys/p/1703166.html
Copyright © 2011-2022 走看看