Search code examples
c#imagepngazure-web-app-servicemetafile

Azure Web App, how to convert image/x-emf to png? [ C# ]


How can I convert emf (image/x-emf) files to png without using "MetaFile class" which seems to not work in Azure Web Apps. It works on self hosted sites.

I don't seem to find any alternative.

Source Code: https://github.com/KeesCBakker/KeesTalksTech-Utility-Pack/tree/master/KeesTalksTech-Utility-Pack/KeesTalksTech.Utilities/Graphics

Here is someone who seems to have similar error: Calling Chart.SaveImage() in Azure WebApp results in GDI+ Exception for ChartImageFormat.EMF only


Solution

  • Azure Web App runs in sandbox, some GDI+ components do not have permission. Please refer to this article for more information about Azure Web App sandbox. For this scenario, please try to use cloud service or azure VM.