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

     显示效果

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

  • 相关阅读:
    POJ 2159 Ancient Cipher 难度:0
    POJ 3299 Humidex 难度:0
    POJ 1503 Integer Inquiry 大数 难度:0
    POJ 2262 Goldbach's Conjecture 数学常识 难度:0
    POJ 1083 Moving Tables 思路 难度:0
    PAT 甲级 1126 Eulerian Path
    Java 大数运算
    PAT 甲级 1010 Radix
    PAT 甲级 1137 Final Grading
    PAT 甲级 1064 Complete Binary Search Tree
  • 原文地址:https://www.cnblogs.com/blueSkys/p/1703166.html
Copyright © 2011-2022 走看看