0

I'm using SkiaSharp to generate images, and it's very hard to debug the image generation code without visual trace. I discovered there's skia debugger and it can help a lot.

I have SKCanvas created from SKBitmap, and I would like to get SKPicture from it so I can serialize it in order to load it into skia debugger.

I wasn't able to find the API to do it.

How can I do it? What approach should I take to get SKPicture from SKBitmap to see the trace of what skia does?

Michael Kruglos
  • 1,205
  • 14
  • 26
  • 1
    Maybe not the best answer but you can use an `SKBitmapImageSource` to set your bitmap as the `Source` of an `Image`. Btw. I have a future plan to add `SKBitmap` support to my [debugger visualizers](https://marketplace.visualstudio.com/items?itemName=KGySoft.drawing-debugger-visualizers-x64) (if you use Visual Studio). It will not happen very soon though, as I didn't even finish the Skia specific package for my [drawing libraries](https://github.com/koszeggy/KGySoft.Drawing) yet. – György Kőszeg Dec 23 '22 at 14:52
  • 1
    In case you're interested, the latest version of my [debugger visualizers](https://marketplace.visualstudio.com/items?itemName=KGySoft.drawing-debugger-visualizers-x64) support also SkiaSharp types (on Windows, in VisualStudio). – György Kőszeg Jun 16 '23 at 13:59

0 Answers0