我需要在漫游器中发送图像。将我的图像转换为字节数组。
在模拟器中图像正在发送,但是在Facebook中,它没有发送。
下面是我的代码。
byte[] imageBytes12 = my image;
string url = "data:image/png;base64," + Convert.ToBase64String(imageBytes12);
var attachmentsImage = new List<Attachment>();
var replyImage = MessageFactory.Attachment(attachmentsImage);
HeroCard menuCardImage = Cards.HeroImageCard(url);
replyImage.Attachments.Add(menuCardImage.ToAttachment());
await stepContext.Context.SendActivityAsync(replyImage, cancellationToken);
我见过
当图像转换为字节时,太长而无法作为ContentUrl发送,这就是为什么它失败了。 任何帮助表示赞赏。
谢谢
答案 0 :(得分:0)
当使用太大的图像作为数据URL进行嵌入时,您需要在服务器上提供指向该图像的链接