Im currently trying to write a function to combine two images from azure storage to one image. I dont know how to setup my function class so that I can trigger the function in powerapps with 2 selected images.
This is my class
public static class Function1
{
[Obsolete] // switch TraceWrite to Ilogger
[FunctionName("Function1")]
public static void Run(string background, string overlay, CloudBlockBlob outputBlob, TraceWriter log)
{
log.Info($"Function triggered with blob\n Background: {background} \n Overlay: {overlay}");
ConvertMe Converter = new ConvertMe(System.Drawing.Color.Black); // My ImageEdit Class I have written
Bitmap _Main = new Bitmap(background);
Bitmap Overlay = Converter.MakeTransparent(overlay);
using (MemoryStream memory = new MemoryStream())
{
Converter.ComebineBitmap(_Main, Overlay).Save(memory, ImageFormat.Jpeg);
memory.Position = 0;
outputBlob.Properties.ContentType = "image/jpeg";
outputBlob.UploadFromStreamAsync(memory);
}
}
}