【发布时间】:2020-03-20 17:30:27
【问题描述】:
在 UWP 应用程序中,我可以使用此代码将 StorageFile 设置为桌面和锁屏的设备壁纸:
public static async System.Threading.Tasks.Task ApplyWallpaper(StorageFile storageFile)
{
await UserProfilePersonalizationSettings.Current.TrySetWallpaperImageAsync(storageFile);
await UserProfilePersonalizationSettings.Current.TrySetLockScreenImageAsync(storageFile);
}
寻找 Xamarin.Android 我找到了 WallpaperManager,但我真的不知道如何准确地使用它。
static WallpaperManager myWallpaperManager;
public static void ApplyToDesktop(Bitmap bitmap)
{
myWallpaperManager.SetBitmap(bitmap);
}
你能告诉我 Xamarin.Android 的 UWP 代码等效吗?
【问题讨论】:
-
SetBitmap 看起来很简单。使用它有什么不明白的地方?
-
如何在锁屏上进行操作?
标签: c# android xamarin bitmap wallpaper