Example #1
0
        public string GetWallpaperImage()
        {
            if (File.Exists(_temporaryWaitForDeleteFiles))
            {
                return(_temporaryWaitForDeleteFiles);
            }

            var fileName = "10." + RegularExpressionHelpers.AlphabetCleaner($"{_player.Track}-{_player.Album}-{_player.Artist}") + ".jpg";

            if (!CacheFileManager.IsFileExists(fileName))
            {
                using var image = this.CalculateBackgroundImage((int)System.Windows.SystemParameters.PrimaryScreenWidth, (int)System.Windows.SystemParameters.PrimaryScreenHeight);
                var bytes = image.ToByteArray(ImageFormat.Jpeg);
                CacheFileManager.SaveCache(fileName, bytes);
            }

            return(CacheFileManager.GetFullCachePath(fileName));
        }