Exemplo n.º 1
0
        private async Task UpdateIconAsync(string User)
        {
            var IconUrl = GitHub.GetIconUrl(User);

            if (!(AlphaImageProxy.GetFromCache(IconUrl)?.Any() ?? false))
            {
                var Binary = await AlphaImageProxy.Get(IconUrl);

                if (Binary?.Any() ?? false)
                {
                    OnUpdateIcon(User, Binary);
                }
            }
        }
Exemplo n.º 2
0
        public virtual async Task <ImageSource> MakeOmegaImageSourceFromUrl(string Url)
        {
            //return ImageSource.FromUri(new Uri(Url));
            //	↑こちらのコードでも良いが、効率化の為に SkiaSharp 用のバイナリと同じモノを使い回す
            var Binary = await AlphaImageProxy.Get(Url);

            if (Binary?.Any() ?? false)
            {
                return(ImageSource.FromStream(() => new System.IO.MemoryStream(Binary)));
            }
            else
            {
                Debug.WriteLine($"MakeOmegaImageSourceFromUrl(\"{Url}\") is failed");
            }
            return(null);
        }