public void ShowWindowFon() { WallpaperSetting ws = WallpaperSetting.Load(); Color color = Color.FromArgb(ws.ColorA, ws.ColorR, ws.ColorG, ws.ColorB); this.viewWindow.Background = new SolidColorBrush(color); this.viewWindow.imgFon.Visibility = Visibility.Hidden; }
public void RefreshPicture() { WallpaperSetting ws = WallpaperSetting.Load(); if (File.Exists(ws.Path)) { File.Copy(ws.Path, ExplorerNet.Sys.AppInfo.PictureFilePath, true); } }
public static WallpaperSetting Load() { //Properties.Settings.Default.WallpaperSetting = null; WallpaperSetting wallpaperSetting = null; if (Properties.Settings.Default.WallpaperSetting == null) { wallpaperSetting = new WallpaperSetting(); wallpaperSetting.Kind = WallpaperKind.Fon; wallpaperSetting.ColorB = 255; Properties.Settings.Default.WallpaperSetting = wallpaperSetting; } else { wallpaperSetting = Properties.Settings.Default.WallpaperSetting; } return wallpaperSetting; }
private void ShowPicture() { WallpaperSetting ws = WallpaperSetting.Load(); string pictPath = ExplorerNet.Sys.AppInfo.PictureFilePath; byte[] buffer = System.IO.File.ReadAllBytes(pictPath); var ms = new MemoryStream(buffer); var bitmapImage = new BitmapImage(); bitmapImage.BeginInit(); bitmapImage.StreamSource = ms; bitmapImage.EndInit(); this.viewWindow.imgFon.Stretch = ws.Stretch; this.viewWindow.imgFon.Source = bitmapImage; this.viewWindow.imgFon.Visibility = Visibility.Visible; //ms.Close(); }
public void Init() { //var wm = new WallpaperManager(); WallpaperSetting ws = WallpaperSetting.Load(); if (ws.Kind == WallpaperKind.Fon) { Color color = Color.FromArgb(ws.ColorA, ws.ColorR, ws.ColorG, ws.ColorB); ShowWindowFon(); } else if (ws.Kind == WallpaperKind.Picture) { ShowPicture(); } }
public static WallpaperSetting Load() { //Properties.Settings.Default.WallpaperSetting = null; WallpaperSetting wallpaperSetting = null; if (Properties.Settings.Default.WallpaperSetting == null) { wallpaperSetting = new WallpaperSetting(); wallpaperSetting.Kind = WallpaperKind.Fon; wallpaperSetting.ColorB = 255; Properties.Settings.Default.WallpaperSetting = wallpaperSetting; } else { wallpaperSetting = Properties.Settings.Default.WallpaperSetting; } return(wallpaperSetting); }