【发布时间】:2020-05-26 21:36:00
【问题描述】:
我目前正在尝试编写一个函数来将两个图像从 azure 存储合并为一个图像。 我不知道如何设置我的函数类,以便我可以在具有 2 个选定图像的 powerapps 中触发该函数。
这是我的课
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);
}
}
}
【问题讨论】:
-
到目前为止,我知道你不能直接从
Power Apps调用Azure Function,你可以使用Microsoft flow或logic App。步骤是,1.Call azure function on logic app or Microsoft flow2.Bind Power apps with flow or Logic App -
好吧,我不知道。你知道如何为此设置我的课程吗?我是 Azure 函数的新手,它在我的函数和 hello world 教程函数之间迈出了一大步 ^^
-
您的意思是如何在
azure function上添加课程? -
我的意思是我上面的功能。我不知道如何配置和设置。我也不确定这个功能是否像这样工作。
标签: c# image azure-functions azure-blob-storage powerapps