使用botframework将字节数组显示为图像

May*_*ore 3 botframework

我有一个用户上传的图片的字节数组.我需要使用Bot-frameworkSkype和其他频道上将此字节数组渲染为图像

Lar*_*ars 5

图像可以作为base64编码发送:

        byte[] imagedata = {your image}
        var image64 = "data:image/jpeg;base64," + Convert.ToBase64String(imagedata);

        reply.Attachments.Add(new Attachment()
        {
            ContentUrl = image64,
            ContentType = "image/jpeg",
        });
Run Code Online (Sandbox Code Playgroud)