UIElement.OpacityMask 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定不透明度遮罩,作為 Brush 一套實作,適用於該元素渲染內容的任意 alpha 通道遮罩。 這是相依性屬性。
public:
property System::Windows::Media::Brush ^ OpacityMask { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush OpacityMask { get; set; }
member this.OpacityMask : System.Windows.Media.Brush with get, set
Public Property OpacityMask As Brush
屬性值
用來遮蔽透明度的刷子。
範例
以下標記範例展示了 ImageBrush 將不透明度遮罩套用於另一個 Image。
<!-- With the Opacity Mask-->
<Image
Height="150"
Width="200"
Source="sampleImages/Waterlilies.jpg"
HorizontalAlignment="Left"
Margin="10"
Grid.Column="2" Grid.Row="1">
<Image.OpacityMask>
<ImageBrush ImageSource="sampleImages/tornedges.png"/>
</Image.OpacityMask>
</Image>
備註
此特性僅使用所提供 Brush的 α 通道值。 其餘的渲染通道 Brush(紅色、綠色或藍色)則被忽略。
最典型 Brush 的符號是 ImageBrush,可用於各種照片遮罩技術,例如短片。 但任何定義 Brush (例如 LinearGradientBrush)都可以使用。
在可擴充應用標記語言(XAML)中,這個屬性值可以使用針對每個抽象類別實作 Brush 專屬的內嵌語法。 更多資訊請參閱《 純色與漸層繪畫概述》。
相依財產資訊
| Item | 價值觀 |
|---|---|
| 識別碼欄位 | OpacityMaskProperty |
元資料屬性設為 true |
None |