public static void SetWallpaper(Image image) { var path = Path.GetTempFileName(); image.Save(path); WallpaperChangingProvider.SetWallpaper(path); }
public static void SetWallpaper(string filePath) { WallpaperChangingProvider.SystemParametersInfo( WallpaperChangingProvider.SPI_SETDESKWALLPAPER, 0, filePath, WallpaperChangingProvider.SPIF_UPDATEINIFILE); }
public static void SetWallpaper(Uri uri) { using (var webClient = new WebClient()) { var file = Path.GetTempFileName(); webClient.DownloadFile(uri.ToString(), file); WallpaperChangingProvider.SetWallpaper(file); } }