UIElement.BitmapEffect 屬性

定義

警告

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

屬性值

BitmapEffect

要套用的點陣圖效果。

屬性

範例

下列範例會使用 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

適用於