WPF OpacityMask property in VB.NET
In this article we will learn how to use OpacityMask property in WPF using VB.NET.
In this article we will learn how to use OpacityMask property in WPF using VB.NET.
OpacityMask
In WPF the most of controls expose a property called OpacityMask which allows to create transparency areas along the object itself and diffuse those areas in different manners.
For example
Taking a image control on the form and set the source property of the Image control.
Figure 1.
XAML code
<Image Height="140" HorizontalAlignment="Left" Margin="113,72,0,0" Name="Image1" VerticalAlignment="Top"
Width="200" Source="/WpfApplication28;component/Images/flowers-image.jpg" Stretch="Fill" />
Now using OpacityMask property to the Image object.
Figure 2.
XAML code
<Image Height="140" HorizontalAlignment="Left" Margin="113,72,0,0" Name="Image1" VerticalAlignment="Top"
Width="200" Source="/WpfApplication28;component/Images/flowers-image.jpg" Stretch="Fill" OpacityMask="#710095AA"></Image>
The form looks like this.
Figure 3.