UIElement.BitmapEffect UIElement.BitmapEffect UIElement.BitmapEffect UIElement.BitmapEffect Property

定义

警告

此 API 现已过时。

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

public:
 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.")]
[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

属性值

要应用的位图效果。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. 请注意, 一个实现的派生类是一种集合类型, 它允许你使用嵌套BitmapEffect标记语法指定多个顺序。Note 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

适用于