Exemple #1
0
        public static void SetWallpaper(Image image)
        {
            var path = Path.GetTempFileName();

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