透明的 UWP 窗口 10 [英] Transparent UWP windows 10

查看:46
本文介绍了透明的 UWP 窗口 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想弄清楚如何在应用程序上设置透明背景,让用户看到背后.我尝试更改 xaml 文件中的 backgroundopacity 参数,但没有任何改变.

我也在背景中设置了透明图像

<ImageBrush Stretch="Fill" ImageSource="Assets/fond.png"/></Page.Background>

但它不起作用

有人知道如何执行此操作吗?

解决方案

tl;dr

也许这不是直接的透视",但我认为这是您想要的.

我认为它在 SDK Preview 中可用,但我不确定,因为我没有尝试过.

关于 Anniversary SDK Preview 的信息https://developer.microsoft.com/en-我们/windows/downloads/windows-10-developer-preview

SDK 在这里https://insider.windows.com/

更新:

我刚刚注意到在 Compositor 类中预发布了 CreateHostBackdropBrush() 函数.https://docs.microsoft.com/en-us/uwp/api/windows.ui.composition.compositor

更新:

在 Fall Creators Update 中,它甚至可以作为 XAML 代码使用,非常快速且易于编写.

链接:https://docs.microsoft.com/en-us/窗户/uwp/设计/风格/亚克力

I am trying to figure out how to have a transparent background on the app, that lets the user see behind it. I've tried to change background and opacity parameters in xaml file, but nothing changed.

I have set a transparent image in background also

<Page.Background>
    <ImageBrush Stretch="Fill" ImageSource="Assets/fond.png"/>
</Page.Background>

But it doesn't work

Does anyone know how to perform this?

解决方案

tl;dr https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic

You will be able to do it after the update of Windows 10 that is coming.

Here: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/8232264-enable-blur-and-transparency-xaml-effects-to-allow?tracking_code=8e9425d1ccc153460b32b85ed3253c90

And the github: https://github.com/Microsoft/WindowsUIDevLabs/tree/master/SampleGallery/Samples/SDK%20Insider/BlurPlayground

Maybe it's not the straight "see through", but I think it's what you would like to have.

EDIT: I think it is available in the SDK Preview, but I'm not sure because I didn't try it.

Info about Anniversary SDK Preview https://developer.microsoft.com/en-us/windows/downloads/windows-10-developer-preview

SDK is here https://insider.windows.com/

UPDATE:

I've just noticed prelease of CreateHostBackdropBrush() function in Compositor class. https://docs.microsoft.com/en-us/uwp/api/windows.ui.composition.compositor

UPDATE:

In Fall Creators Update it's even available as XAML code that's very fast and easy to write.

Link: https://docs.microsoft.com/en-us/windows/uwp/design/style/acrylic

这篇关于透明的 UWP 窗口 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆