System.Drawing is not supported in Azure Functions, therefore Image class cannot be used to convert byte array into Image. Then how do we convert byte arrays into Image in Azure Functions that uses C#Script where System.Drawing is not recognized as a valid namespace
The images are stored in a database in BYTE ARRAY format. Later when the byte arrays are needed to be converted to image, to embed them in the emails, the code displays error since Image namespace is not recognized in Azure functions. System.Drawing dll is not supported in Azure Function. Is there an alternative to the below code to convert byte array to Images:
MemoryStream imageMemoryStream = new MemoryStream(imageFromDatabase.Data);
Image imageFromStream = Image.FromStream(imageMemoryStream);
var inlineImage = new LinkedResource(imageFromStream, imageFromDatabase.ContentType)
{
ContentId = Guid.NewGuid().ToString()
};
att.Value = string.Format("cid:{0}", inlineImage.ContentId);
linkedResources.Add(inlineImage);
Expected results: Byte arrays are converted to Images