Redth / ResizetizerNT

Add SVG's and PNG's to your shared Xamarin Project
MIT License
318 stars 31 forks source link

Improve SkiaSharp, add unit tests and add TintColor support #6

Closed mattleibow closed 4 years ago

mattleibow commented 4 years ago

Started off as a quick improvement to the usage of SkiaSharp to save files, but became... well... more. 😎

Saving files Instead of using the "native" Svg.Skia way of saving files, I switched to daring it myself to reduce the number of copies and transforms. Now there is just a single set of allocation, draw and encode. We first allocate the new, resized icon, then we draw the scaled icon, and finally encode directly to a file stream.

Unit tests ...

TintColor support In order to show off the coolness of SkiaSharp, I quickly added a few lines of SkiaSharp to get 100% tint-able SVG.