I am writing an application in Avalonia and using OpenCvSharp to get frames from the camera. This worked with WPF - there I just called
Image.Source = Mat.ToBitmapSource();
but this doesn't work in Avalonia, because there is a different type of Image control, and a different type of its Source property.
I tried doing this via a MemoryStream, but then the Bitmap constructor crashes with an ArgumentNullException (although the stream is not null).