简体   繁体   English

WinUI3:如何在 Canvas 上放置一个半透明的灰色覆盖层

[英]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.

相关问题 WinUI3:了解 WinUI3 桌面应用程序 - WinUI3 : Understanding WinUI3 desktop app WINUI3 - 自定义标题栏 - WINUI3 - Customize TitleBar C++中如何获取WinUI3中控件的句柄? - How to get a control's handle in WinUI3 in C++? C++/WinRT WinUI3:如何通过WebView2获取html源代码? - C++/WinRT WinUI3: How to get html source code by WebView2? WinUI3:如何知道在 UIElement.drop() 事件中删除了哪个 uielement - WinUI3 : how to know which uielement was dropped in UIElement.drop() event C++/WinRT WinUI3:如何在关闭 MainWindow 之前显示 ContentDialog? - C++/WinRT WinUI3: How to show a ContentDialog before I close the MainWindow? WinUI3:处理 WinUI3 桌面中的网络更改事件 c++ - WinUI3 : Handle network change event in WinUI3 desktop with c++ WinUI3在C++桌面开发中不支持AcrylicBrush的Background属性。 有没有其他方法可以做到这一点? - WinUI3 does not support the Background Property of AcrylicBrush in C++ desktop development. Is there any alternative way of doing it? 获取窗口图标,将其放在画布上,覆盖图像,另存为ico(WinXP和Win7) - Get window icon, put it on canvas, overlay image, save as ico (WinXP and Win7) 当我将密码输入到 QT 中的 QInputDialog 时,如何设置背景不活动和灰色? - How to set background inactive and grey while i put a password to a QInputDialog in QT?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM