Example #1
0
        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;
        }
Example #2
0
        public void RefreshPicture()
        {
            WallpaperSetting ws = WallpaperSetting.Load();

            if (File.Exists(ws.Path))
            {
                File.Copy(ws.Path, ExplorerNet.Sys.AppInfo.PictureFilePath, true);
            }
        }
Example #3
0
        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();
        }
Example #4
0
        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();
            }
        }