Search code examples
c++uwpwinui-3windows-app-sdkcppwinrt

WinUI3 : How to put an translucent grey overlay on Canvas


I'm working on a WinUI3 desktop application in c++. I was trying to achieve an experience where we can show a ProgressRing in the center of the screen when there is a delay in screen update. In my application, my window has a Canvas as its content and that canvas contains many widgets. I want to put a new Canvas as an overlay on top of the existing Canvas and show a ProgressRing on the new Overlay Canvas and I was able to achieve an experience like this. enter image description here The overlay Canvas in the image has a background color as transparent, I wanted to make the overlay canvas translucent. So that all the widgets below the overlay canvas will look like grayed-out non-interactive widgets.

I would be of great help if you could help me with this issue.

Thank you,

Harshithraj P


Solution

  • One way to do that is to set the Background("Black" maybe?) and the Opacity depending on how you want it to look.