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

     显示效果

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

  • 相关阅读:
    [转].net批量导入数据
    IIS6 应用程序池配置详解附建议设置
    [转]SQLServer死锁问题
    VSS 版本管理
    非功能性需求介绍[转]
    javascript获取网页中HTML元素
    [转]如何做一流的研究
    多web并发测试问题解决
    jQuery 页面校验
    SqlServer排序规则错误致使不能查询
  • 原文地址:https://www.cnblogs.com/blueSkys/p/1703166.html
Copyright © 2011-2022 走看看