diff --git a/.gitignore b/.gitignore index 3a68566..486e69b 100644 --- a/.gitignore +++ b/.gitignore @@ -231,3 +231,4 @@ _Pvt_Extensions # FAKE - F# Make .fake/ /Blurhash.SkiaSharp.sln +TestMobileApp/ \ No newline at end of file diff --git a/ex1.gif b/ex1.gif new file mode 100644 index 0000000..97ab6bb Binary files /dev/null and b/ex1.gif differ diff --git a/readme.md b/readme.md index b9440cc..9b516b0 100644 --- a/readme.md +++ b/readme.md @@ -3,23 +3,22 @@ [![NuGet](https://img.shields.io/nuget/v/Blurhash.SkiaSharp.svg)](https://www.nuget.org/packages/BlurHash.SkiaSharp/) A [Blurhash](https://github.com/woltapp/blurhash) implementation based on -[blurhash.net](https://github.com/MarkusPalcer/blurhash.net) for SkiaSharp. +[blurhash.net](https://github.com/MarkusPalcer/blurhash.net) for SkiaSharp, thus +fully available for Xamarin and other .NET Standard 2.0 platforms. -Currently allows to decode a blurhash into `SKBitmap`. Encoding of SKBitmap into -blurhash is not supported as of 1.0. +Currently allows to decode a blurhash into `SKBitmap`. Creation of blurhash from +images is not supported as of 1.0. Several portions of the code are directly copy-pasted from the [System.Drawing implementation](https://github.com/MarkusPalcer/blurhash.net/tree/master/Blurhash-System.Drawing). -Tested on UWP and Android. +Tested on Xamarin.Forms on UWP, iOS and Android. ## Example usage ### Displaying a placeholder for an image in Xamarin.Forms Image control ```csharp -using Blurhash.Skia; - // ... var decoder = new Blurhash.SkiaSharp.Decoder(); @@ -27,4 +26,6 @@ var im = decoder.Decode("LEHV6nWB2yk8pyo0adR*.7kCMdnj", 219, 176); var data = SKImage.FromBitmap(im).Encode(); image1.Source = ImageSource.FromStream(data.AsStream); -``` \ No newline at end of file +``` + +![Example of Xamarin.Forms image with Blurhash switching to loaded image](https://raw.githubusercontent.com/ktos/Blurhash.SkiaSharp/master/ex1.gif)