コード例 #1
0
        public async Task UriReturnsSimilarImage()
        {
            TestUtils.EnsureFormsInit();

            using var image = SKImage.FromEncodedData("images/logo.png");
            var info = new SKImageInfo(image.Width, image.Height, image.ColorType, image.AlphaType, image.ColorSpace);

            var source = new UriImageSource {
                Uri = new Uri("https://raw.githubusercontent.com/mono/SkiaSharp.Extended/main/images/logo.png")
            };

            var result = await source.ToSKImageAsync();

            Assert.NotNull(result);

            var resultInfo = new SKImageInfo(result.Width, result.Height, result.ColorType, result.AlphaType, result.ColorSpace);

            Assert.Equal(info, resultInfo);
        }