I'm trying to do a method that can convert a Emgu.Cv.Mat image into a System.Drawing.Bitmap image.
public Bitmap convertCvToBitmap(Mat img)
{
byte[] temp_img = this.convertCvToImage(img);
Bitmap mp;
using (var ms = new MemoryStream(temp_img))
{
mp = new Bitmap(ms);
}
return mp;
}
Firstly I the convert Emgu.Cv.Mat image into a byte[] image, and then I convert this byte[] image into a System.Drawing.Bitmap image.
This method works on a desktop but doesn't when used in a Xamarin Android App, I've got this error: "System.PlatformNotSupportedException: 'Operation is not supported on this platform.'".
I know it's coming from this line of code: mp = new Bitmap(ms);
(I checked it before using Console.WriteLine
)
Can anyone knows the problem or if there is another path to convert an Emgu.Cv.Mat image into a System.Drawing.Bitmap image?
Thanks!