コード例 #1
0
ファイル: Wall.cs プロジェクト: PRSears/DesktopVeneer
        /// <summary>
        /// Loads the image at %AppData%\TranscodedWallpaper, stores it in this.TranscodedWallpaper,
        /// and returns the same Image.
        /// Called automatically by constructor.
        /// Do not call if you don't need to update the Image stored in this.TranscodedWallpaper.
        /// </summary>
        public bool Reload()
        {
            this.FreeImages();

            try
            {
                this.TranscodedWallpaper = Bitmaps.FromFile(this.DesktopBackgroundPath);
            }
            catch (IOException e)
            {
                Console.WriteLine(Extender.Exceptions.ExceptionTools.CreateExceptionText(e, true));
                return(false);
            }

            this.ScaledWallpaper = ScaledWallpaper; // forces a re-scale with new TranscodedWallpaper
            return(true);
        }