【发布时间】:2016-12-03 17:54:50
【问题描述】:
我正在为服务构建一个 AngularJS 应用程序,我使用 .NET C# 进行编码。现在我正在遵循以下帖子Load image from C# Byte array and place image in html tag using AngularJS中提到的代码结构 -
但是在上述方法中,他们将图像作为 Base64 Sting 发送,在这里我们将 Base64 绑定到 Angular HTML 中。它会降低加载性能。在我的一篇文章中,我得到了一个相关的答案Compress a Byte Array Image without Scaling using .Net C#,上面写着“发送数据通常而不是 Base64”字符串。
请帮助我如何在 HTML <img /> Tag 中显示字节数组图像。目前我正在使用以下
<img ng-src="data:image/jpeg;base64,{{ image.Content }}" />
【问题讨论】:
标签: c# html angularjs image bytearray