UIElement.BitmapEffect Property



This API is now obsolete.

获取或设置一个位图效果,该效果将直接应用到此元素所呈现的内容。Gets or sets a bitmap effect that applies directly to the rendered content for this element. 这是依赖项属性。This is a dependency property.

 property System::Windows::Media::Effects::BitmapEffect ^ BitmapEffect { System::Windows::Media::Effects::BitmapEffect ^ get(); void set(System::Windows::Media::Effects::BitmapEffect ^ value); };
[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.")]
public System.Windows.Media.Effects.BitmapEffect BitmapEffect { get; set; }
member this.BitmapEffect : System.Windows.Media.Effects.BitmapEffect with get, set
Public Property BitmapEffect As BitmapEffect

Property Value


要应用的位图效果。The bitmap effect to apply.



下面的示例使用 BlurBitmapEffect设置位图效果。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 是抽象类型,因此 XAMLXAML 使用需要 BitmapEffect实现的派生类,例如 OuterGlowBitmapEffectBitmapEffect is an abstract type, therefore the XAMLXAML usage requires an implemented derived class of BitmapEffect, such as OuterGlowBitmapEffect. 请注意,一个实现的派生类是一种集合类型,它允许你使用嵌套标记语法指定多个顺序 BitmapEffectNote that one implemented derived class is a collection type that allows you to specify more than one sequential BitmapEffect, using a nested tag syntax.

BitmapEffect 的现有派生类都不支持类型转换器,因此,用于此属性的 XAMLXAML 语法通常是属性元素语法。No existing derived class of BitmapEffect supports a type converter, so the XAMLXAML syntax that you use for this property is generally property element syntax.

依赖项属性信息Dependency Property Information

标识符字段Identifier field BitmapEffectProperty
元数据属性设置为 trueMetadata properties set to true NoneNone

Applies to