I'm using a library (spire.pdf) to extract images from a PDF file that I ask from the user. The library returns me an array of System.Drawing.Image and I'm currently trying to figure out how to convert those to Microsoft.Maui.Controls.Image
First, I'm storing the System.Drawing.Image in a MemoryStream, which does work correctly (see screenshot). But my output Maui Image doesn't get any content. (ImageSource.FromStream)
Am I missing something here? I'm adding my Convert method here, Thanks in advance for the help!
private Image Convert(System.Drawing.Image img)
{
MemoryStream stream = new MemoryStream();
img.Save(stream, System.Drawing.Imaging.ImageFormat.Bmp);
Image output = new Image()
{
Source = ImageSource.FromStream(() => stream)
};
return output;
}