0

I'm using Azure functions for a project involving text recognition. I originally converted the byte[] to an image, and then cropped the image to focus on the parts I wanted using libraries from System.Drawing. However when moving to Azure it appears that it doesn't support System.Drawing. I still need to crop my image however, but I don't know how to directly crop the byte[] in C# without using any libraries like Bitmap/Rectangle/DrawImage etc.

How can I given a byte[] and the x/y/width/height of the area I want to crop get a new byte[] that is the cropped version of the old one?

  • Have you seen this post: https://stackoverflow.com/questions/51904125/azure-function-gives-error-system-drawing-is-not-supported-on-this-platform – David Tansey Oct 02 '19 at 15:16
  • ...and another with a lot more detail and code examples: http://jameschambers.com/2016/11/Resizing-Images-Using-Azure-Functions/ – David Tansey Oct 02 '19 at 15:18