Skip to content

Version 1.55.0

Compare
Choose a tag to compare
@mattleibow mattleibow released this 10 Nov 16:43

SkiaSharp

A cross-platform 2D graphics API for .NET platforms based on Google's Skia Graphics Library. It provides a comprehensive 2D API that can be used across mobile, server and desktop models to render images.

  • Updated to the latest version of Google's Skia: chrome/m55
  • Many new features and improvements:
    • Improved exceptions for invalid/incorrect arguments
    • Added parsing HTML hex colors: SKColor.Parse and SKColor.TryParse
    • Added more clipping options for SKCanvas, such as SKRegion
    • Added SKPaint.GetFillPath() to create a new path using the fill properties
    • Added numerous overloads and members to SKPath
    • Added SKPathMeasure for measuring and segmenting paths
    • Added getters for SKTypeface properties
    • Additional members and overloads for SKRect*, SKSize* and SKPoint*
    • Additional overloads for SKMatrix
    • Improved image lattice drawing
    • Improved the internals for GRGlInterface on UWP
  • Changes from Google's Skia:
    • GRContext.Flush(GRContextFlushBits) is now obsolete. Use GRContext.Flush().
    • SKDocument.Close() no longer returns bool. Returns void.
    • SKPaint.XferMode is now obsolete. Use SKPaint.BlendMode.
  • Documentation:
    • Added thousands of docs, over the entire SkiaSharp API

NuGet: https://www.nuget.org/packages/SkiaSharp/1.55.0

SkiaSharp.Views

A set of pre-prepared UI views, panels and surfaces for drawing. One of these views can be added to the view hierachy, and then be used for drawing without the need for complex setup. There is also a set of extension methods for converting to/from SkiaSharp and native types.

  • A few small improvements
  • Added <some-view>.CanvasSize which can be used to calculate scaling/pixel density:
    var scaling = view.CanvasSize.Width / view.Width;
  • The namespace is now in the format SkiaSharp.Views.<platform-name>

NuGet: https://www.nuget.org/packages/SkiaSharp.Views/1.55.0

SkiaSharp.Views.Forms

A set of pre-prepared views for Xamarin.Forms, for fully cross-platform drawing code. There are views for both CPU and GPU backends, along with extension methods for converting to/from SkiaSharp and Xamarin.Forms types. Currently available for iOS, Android and UWP.

NuGet: https://www.nuget.org/packages/SkiaSharp.Views.Forms/1.55.0

NEW SkiaSharp.Svg (preview)

Support for SVG has been a hot topic, but Google has stated that this is not going to be a feature coming soon (or at all). However, we do want to support SVG. To this end, we are trying out a lightweight SVG parser. This is a pure managed code parser, that actually lives in a single file.

This implementation of SVG is very limited, but supports all the features supported by the alternate NGraphics library. We are looking to add new features, so please do create issues when you need a feature that does not exist yet.

Another SVG library that has recently had SkiaSharp support added is SVG by @gentledepp. If you need more features than what we have, please create an issue, but remember you can also try this library out as well.

NuGet: https://www.nuget.org/packages/SkiaSharp.Svg/1.55.0-beta1

Samples

A few new samples were added to demonstrate some new features.

All the samples that have been built and tested for this version of SkiaSharp can be downloaded in the "Downloads" links below.