我正在尝试断定从api调用返回的图像的宽度和高度。
EventProcessorOptions options = new EventProcessorOptions();
options.OnShutdown = OnShutdown;
options.EnableReceiverRuntimeMetric = true;
// tried this one as well, doesn't help
//options.ClientReceiverOptions = new Microsoft.Azure.EventHubs.ReceiverOptions()
//{
// EnableReceiverRuntimeMetric = true
//};
ServiceFabricProcessor processorService = new ServiceFabricProcessor(this.Context.ServiceName, this.Context.PartitionId, this.StateManager, this.Partition,
new EventProcessor(), eventHubConnectionString, "$Default", options);
是Content-Type
,仅仅是来自api的原始数据。
我正在尝试创建一个元素并将png放入其中。
image/png
但是出现错误:
var img = document.createElement('IMG');
img.src = "data:image/png;base64," + responseBody;
console.log(img.naturalWidth);
console.log(img.naturalHeight);
编辑:用户在此处建议的替代方法如下:
ReferenceError | document is not defined
但是我仍然无法从中获取图像大小。
在邮递员中实现此目标的推荐方法是什么?