0

Any easy way to apply OpacityMask to a UI object in UWP XAML?

I used to do that in WPF but appears to be missing in UWP.

user229044
  • 232,980
  • 40
  • 330
  • 338
danbord
  • 3,605
  • 3
  • 33
  • 49

1 Answers1

4

You can partially replicate this functionality, but not in an especially easy way. Windows Composition API offers a similar functionality where you can define a CompositionMaskBrush with which you will "paint over" the UI object to achieve a opacity mask effect.

There is an example as the solution of a GitHub issue that demonstrates such process. The same user also asked on StackOverflow.

You can also check out the CompositionProToolkit that might simplify implementing this.

Martin Zikmund
  • 38,440
  • 7
  • 70
  • 91