WPF OpacityMask property in VB.NET

In this article we will learn how to use OpacityMask property in WPF using VB.NET.
  • 1988
Download Files:
 

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.

om1.gif
 

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.

om2.gif
 

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.

om3.gif

Figure 3.

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.