Shape.GetAlphaMask Shape.GetAlphaMask Shape.GetAlphaMask Shape.GetAlphaMask Method


Returns a mask that represents the alpha channel of a XAML shape as a CompositionBrush.

public : CompositionBrush GetAlphaMask()
CompositionBrush GetAlphaMask() const;
public CompositionBrush GetAlphaMask()
Public Function GetAlphaMask() As CompositionBrush


A mask that represents the alpha channel of a XAML shape.

Additional features and requirements

Device family
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v3)


This method gets an alpha mask from a XAML shape as a CompositionBrush that you can use as an input to composition shadows and effects. The alpha mask CompositionBrush has the same alignment and stretch property values that the source XAML shape applies to its rendered content so that you can use those values to correctly position shadows or effects relative to the XAML element.