使用botframework将字节数组显示为图像 [英] Display byte array as an image using botframework
本文介绍了使用botframework将字节数组显示为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我从用户上传的图片中得到一个字节数组.我需要使用 Bot-framework
I have a byte array from the uploaded pic by the user . I need to render this byte array as an image on Skype and other channels using Bot-framework
推荐答案
图像可以以base64编码形式发送:
Images can be sent as base64 encoded:
byte[] imagedata = {your image}
var image64 = "data:image/jpeg;base64," + Convert.ToBase64String(imagedata);
reply.Attachments.Add(new Attachment()
{
ContentUrl = image64,
ContentType = "image/jpeg",
});
这篇关于使用botframework将字节数组显示为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文