gpt4 book ai didi

c# - 如何复制新 DropBox UWP 应用中的窗口透明效果

转载 作者:太空宇宙 更新时间:2023-11-03 19:47:30 25 4
gpt4 key购买 nike

显然,该效果是创作者更新中引入的一项功能。有没有人想出用于实现这一目标的确切 API?更好的是一些示例代码至少可以帮助我入门。

如有任何帮助,我们将不胜感激。 :]

最佳答案

您应该针对 Windows Creators Update 使其工作

 using Windows.UI.Xaml.Hosting;

//'this' is MainPage, but can be any UIElement
var visual = ElementCompositionPreview.GetElementVisual(this);
var brush = visual.Compositor.CreateHostBackdropBrush();
var sprite = visual.Compositor.CreateSpriteVisual();
sprite.Brush = brush;
//Set to the size of the area, update on SizeChanged
sprite.Size = new System.Numerics.Vector2(1000, 1000);
ElementCompositionPreview.SetElementChildVisual(this, sprite);

关于c# - 如何复制新 DropBox UWP 应用中的窗口透明效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43566178/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com