UIElement.BitmapEffect 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
注意
Avoid using BitmapEffects as they have very poor performance characteristics. They will be deprecated in a future version. Consider using the UIElement.Effect property and ShaderEffects where appropriate instead.
注意
BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.
获取或设置一个位图效果,该效果将直接应用到此元素所呈现的内容。 这是依赖项属性。
public:
property System::Windows::Media::Effects::BitmapEffect ^ BitmapEffect { System::Windows::Media::Effects::BitmapEffect ^ get(); void set(System::Windows::Media::Effects::BitmapEffect ^ value); };
[System.Obsolete("Avoid using BitmapEffects as they have very poor performance characteristics. They will be deprecated in a future version. Consider using the UIElement.Effect property and ShaderEffects where appropriate instead.")]
public System.Windows.Media.Effects.BitmapEffect BitmapEffect { get; set; }
[System.Obsolete("BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.")]
public System.Windows.Media.Effects.BitmapEffect BitmapEffect { get; set; }
[<System.Obsolete("Avoid using BitmapEffects as they have very poor performance characteristics. They will be deprecated in a future version. Consider using the UIElement.Effect property and ShaderEffects where appropriate instead.")>]
member this.BitmapEffect : System.Windows.Media.Effects.BitmapEffect with get, set
[<System.Obsolete("BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.")>]
member this.BitmapEffect : System.Windows.Media.Effects.BitmapEffect with get, set
Public Property BitmapEffect As BitmapEffect
属性值
要应用的位图效果。
- 属性
示例
The following example sets a bitmap effect, using BlurBitmapEffect.
// Get a reference to the Button.
Button myButton = (Button)sender;
// Initialize a new BlurBitmapEffect that will be applied
// to the Button.
BlurBitmapEffect myBlurEffect = new BlurBitmapEffect();
// 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;
// Set the KernelType property of the blur. A KernalType of "Box"
// creates less blur than the Gaussian kernal type.
myBlurEffect.KernelType = KernelType.Box;
// Apply the bitmap effect to the Button.
myButton.BitmapEffect = myBlurEffect;
注解
BitmapEffect 是抽象类型,因此 XAML 用法需要实现的 BitmapEffect派生类,例如 OuterGlowBitmapEffect。 请注意,一个实现的派生类是一种集合类型,可用于使用嵌套标记语法指定多个顺序 BitmapEffect。
没有支持类型转换器的现有派生类,因此用于此属性的 BitmapEffect XAML 语法通常是属性元素语法。
依赖项属性信息
标识符字段 | BitmapEffectProperty |
元数据属性设置为 true |
无 |