public static void SetWallpaper(string imagePath) { IActiveDesktop iad = WallpaperChanger.GetActiveDesktop(); iad.SetWallpaper(imagePath, 0); iad.ApplyChanges(AD_Apply.ALL | AD_Apply.FORCE | AD_Apply.BUFFERED_REFRESH); }
public override void SetWallpaper(string imageFilename) { string imagePath = Path.Combine(Directory.GetCurrentDirectory(), "images", imageFilename); WallpaperChanger.EnableTransitions(); WallpaperChanger.SetWallpaper(imagePath); }
private void SetWallpaper(int imageId) { string imageFilename = String.Format(JsonConfig.imageSettings.imageFilename, imageId); string imagePath = Path.Combine(Directory.GetCurrentDirectory(), "images", imageFilename); WallpaperChanger.EnableTransitions(); WallpaperChanger.SetWallpaper(imagePath); lastImageId = imageId; }