UIElement.BitmapEffect 屬性

定義

警告

BitmapEffects are deprecated and no longer function. Consider using Effects where appropriate instead.

警告

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.

取得或設定直接套用至此元素呈現內容的點陣圖效果。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.")]
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; }
[<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
[<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
Public Property BitmapEffect As BitmapEffect

屬性值

BitmapEffect

要套用的點陣圖效果。The bitmap effect to apply.

屬性

範例

下列範例會使用來設定點陣圖效果 BlurBitmapEffectThe 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

適用於