【发布时间】:2021-09-23 14:57:54
【问题描述】:
我试图从httplistener 发送base64 图片,但由于某种原因它没有呈现:
代码:
var gv = ImageToBase64(new Bitmap("bubble.png"), ImageFormat.Png);
revatry.SetHeaders(res, HttpResponseHeader.CacheControl, "cache", RevatryFramework.Mime.PNG);
// ImageToBase64 is stolen from Stack Overflow. It does properly convert as I send the output to the browser
// Extra code here because I tried some stuff to solve issue, but it didn't help; I removed it again, but I kept the variables
byte[] buffer = gv;
res.ContentLength64 = buffer.Length;
System.IO.Stream output = res.OutputStream; // ponse eul zrehgo
output.Write(buffer, 0, buffer.Length);
revatry.EndRequest(res);
我正在使用这个:https://github.com/blockplacer/Revatry 用于网络, 但无论我尝试什么,我都无法让图片正常工作。
【问题讨论】:
标签: c# httplistener