[英]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.我正在 c++ 中开发 WinUI3 桌面应用程序。我试图实现一种体验,当屏幕更新出现延迟时,我们可以在屏幕中央显示 ProgressRing。 In my application, my window has a Canvas as its content and that canvas contains many widgets.
在我的应用程序中,我的 window 的内容是 Canvas,而 canvas 包含许多小部件。 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.
我想将新的 Canvas 作为现有 Canvas 的叠加层,并在新的叠加层 Canvas 上显示 ProgressRing,我能够获得这样的体验。
The overlay Canvas in the image has a background color as transparent, I wanted to make the overlay canvas translucent.
图像中的叠加层 Canvas 具有透明的背景颜色,我想让叠加层 canvas 半透明。 So that all the widgets below the overlay canvas will look like grayed-out non-interactive widgets.
这样覆盖层 canvas 下方的所有小部件将看起来像灰色的非交互式小部件。
I would be of great help if you could help me with this issue.如果你能帮我解决这个问题,我会很有帮助。
Thank you,谢谢,
Harshithraj P Harshithraj P
One way to do that is to set the Background
("Black" maybe?) and the Opacity
depending on how you want it to look.一种方法是根据您想要的外观设置
Background
(也许是“黑色”?)和Opacity
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.