Table of Contents

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

  • SKColorTable now uses premultiplied colorsSKColorTable correctly uses SKPMColor (premultiplied) instead of SKColor. Passing SKColor values 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 with SKCodec and SKBitmap decoding.
  • SKPMColor — New type for premultiplied colors, with methods for premultiplying and unpremultiplying SKColor values.
  • SKImage expansion — Many new members for constructing pixel-backed and texture-backed images, plus ReadPixels, PeekPixels, ScalePixels, and ApplyImageFilter.
  • SKData creation overloads — Several new overloads for creating SKData instances either as a copy or a wrapper.
  • GRContext.ResetContext — Reset the internal GPU context state.
  • SKCanvas.DrawVertices — Draw vertex-based geometry.
  • **.NET Streamoverloads** — 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/WPF WriteableBitmap, Android/Desktop Bitmap, iOS/tvOS UIImage, Apple CGImage/CIImage, macOS NSImage).
  • SKData/NSData conversion — New extension methods for converting between SKData and Apple NSData.
  • SkiaSharp ImageSource types — New Xamarin.Forms ImageSource types for directly drawing SkiaSharp images.
  • UWP SKXamlCanvas performance — 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; SKDataNSData conversion
🪟 Windows Image conversion for WriteableBitmap; major UWP SKXamlCanvas performance improvements
🤖 Android Image conversion extensions for Bitmap