简体   繁体   English

如何使用 UWP 在 Windows 10 中启用壁纸更改过渡?

[英]How to enable Wallpaper Change Transition in Windows 10 using UWP?

I can successfully use this code to apply an Image as a wallpaper to Desktop and Lockscreen.我可以成功地使用此代码将图像作为壁纸应用于桌面和锁屏。

How do I enable Wallpaper change transition (Fade-In and Fade-Out)?如何启用墙纸更改过渡(淡入和淡出)?

async Task<bool> SetWallpaperAsync(string localAppDataFileName) 
{ 
    bool success = false;
    if (UserProfilePersonalizationSettings.IsSupported())
    {
        var uri = new Uri("ms-appx:///Local/" + localAppDataFileName);
        var file = await StorageFile.GetFileFromApplicationUriAsync(uri);
        var profileSettings = UserProfilePersonalizationSettings.Current;
        success = await profileSettings.TrySetLockScreenImageAsync(file);
    }
    return success;
} 

I need something that works for UWP Applications.我需要一些适用于 UWP 应用程序的东西。

Unfortunately this is not possible in UWP and I don't think the system has this currently itself.不幸的是,这在 UWP 中是不可能的,我认为系统目前没有这个功能。 When you go into Settings - Personalization and change the wallpaper, you can see the wallpaper also changes immediately.当您进入设置-个性化并更改壁纸时,您可以看到壁纸也立即更改。 Same things goes for when you have a slideshow set up.当您设置幻灯片放映时,情况也是如此。 On the other hand, if such a smooth transition gets implemented on the OS level, then I am sure the effect will be the same across the board, even when wallpaper is changed from UWP.另一方面,如果在操作系统层面实现了这样的平滑过渡,那么我相信即使从 UWP 更改壁纸,效果也会全面相同。 So it is definitely something worth suggesting in the Windows Feedback Hub.因此,在 Windows 反馈中心绝对值得提出建议。

There are some desktop customization programs that use hacky solutions to display animations or even videos on the desktop, but those are low level and performance-expensive.有一些桌面定制程序使用 hacky 解决方案在桌面上显示动画甚至视频,但这些程序级别低且性能昂贵。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM