From the course: Visual Studio Developer Tips

Unlock this course with a free trial

Join today to access over 22,600 courses taught by industry experts.

Clipping to a border using an opacity mask

Clipping to a border using an opacity mask - Visual Studio Tutorial

From the course: Visual Studio Developer Tips

Clipping to a border using an opacity mask

- [Instructor] In WPF and other XAML-based UI frameworks the Border element is used to define a border, which is a line that outlines the outside edge of a section of the user interface. Here's an example in this XAML where I've got a Border that contains an Image. The Border is red, the red is defined here. Here's the Border, the red color is defined in a Style Setter up here, so is the BorderThickness and the Centering and the Margin for all of the Borders. In line 31 I'm defining just one property, the Background color is set to Black. And then inside that is a single element, that's one of the rules of the Border class is it can only have a single child. So in this case it's the Image element. This is a good looking representation, you've got a nice red border around this image. Let's go look at the last column. Here I've also defined a Border, but the major difference here is I've defined a CornerRadius of 42. And when you do that it means that the corners of the border are…

Contents