Version 1.56.2
3D transforms, image API expansion, and cross-platform image conversion · Released March 9, 2017 · NuGet · GitHub Release
Highlights
This release adds SKMatrix44 for 3D transformations, SKFrontBufferedStream for decoding non-seekable streams, SKPMColor for premultiplied color handling, and extensive new members on SKImage and SKCanvas. SkiaSharp.Views gains comprehensive image conversion extensions between SkiaSharp types and native platform image types (UIImage, Bitmap, WriteableBitmap, CGImage, NSImage), and UWP SKXamlCanvas gets major performance improvements. Many types that previously only accepted SKStream now have .NET Stream overloads.
Breaking Changes
Color handling
SKColorTablenow uses premultiplied colors —SKColorTablecorrectly usesSKPMColor(premultiplied) instead ofSKColor. PassingSKColorvalues will be premultiplied automatically. This may affect code that was relying on the previous (incorrect) behavior.
New Features
API Surface
SKMatrix44— New type for representing 3D matrix transformations.SKFrontBufferedStream— Wraps non-seekable streams for use withSKCodecandSKBitmapdecoding.SKPMColor— New type for premultiplied colors, with methods for premultiplying and unpremultiplyingSKColorvalues.SKImageexpansion — Many new members for constructing pixel-backed and texture-backed images, plusReadPixels,PeekPixels,ScalePixels, andApplyImageFilter.SKDatacreation overloads — Several new overloads for creatingSKDatainstances either as a copy or a wrapper.GRContext.ResetContext— Reset the internal GPU context state.SKCanvas.DrawVertices— Draw vertex-based geometry.- **
.NETStreamoverloads** — Many types that acceptedSKStreamnow also accept .NETStream` types. - Nested enum refactoring — Moved more nested enumerations out to the root namespace.
Platform
- Cross-platform image conversion extensions — New extension methods in SkiaSharp.Views for converting between SkiaSharp types (
SKBitmap,SKImage,SKPixmap,SKPicture) and native image types (UWP/WPFWriteableBitmap, Android/DesktopBitmap, iOS/tvOSUIImage, AppleCGImage/CIImage, macOSNSImage). SKData/NSDataconversion — New extension methods for converting betweenSKDataand AppleNSData.- SkiaSharp
ImageSourcetypes — New Xamarin.FormsImageSourcetypes for directly drawing SkiaSharp images. - UWP
SKXamlCanvasperformance — Major performance improvements to the UWP canvas. - NuGet native library handling — Installing SkiaSharp into unit test projects or class libraries now correctly copies native libraries to the bin directory.
SVG
- Improved viewbox handling — Continued improvements to SVG viewbox handling in SkiaSharp.Svg.
Bug Fixes
- Fixed a bug where Skia returned the same native instance but SkiaSharp created a new wrapper, causing premature disposal of the shared instance.
Platform Support
| Platform | What's New |
|---|---|
| 🍎 Apple | Image conversion extensions for UIImage, CGImage, CIImage, NSImage; SKData↔NSData conversion |
| 🪟 Windows | Image conversion for WriteableBitmap; major UWP SKXamlCanvas performance improvements |
| 🤖 Android | Image conversion extensions for Bitmap |