Not my field of expertise at all but I found the following which might point you in the right direction -
System.Drawing.Image to SkiaSharp[
^]
MS Learn | System.Drawing.Common only supported on Windows[
^]
Convert System.Drawing.Icon to SkiaSharp.SKBitmap[
^]
From what I could gather, you can use the byte array representation of the 'OpenCvSharp.Mat' image using 'ToBytes()' method and then create an 'SKBitmap' from the byte array using the 'SKBitmap.Decode' method. Your code should look something like the following based on the links given -
using OpenCvSharp;
using SkiaSharp;
Mat mat =
byte[] bytes = new byte[0];
try
{
bytes = mat.ToBytes(".png");
}
catch (Exception ex)
{
}
SKBitmap bitmap = SKBitmap.Decode(bytes);
You might want to handle the exception accordingly if the conversion fails.