I am developing ASP.NET MVC 5 application. I need to display Bitmap image from controller in HTML tag <img />
. How can I do it?
Please read: this question is not "too broad". It specifically asks how to show Bitmap
C# object in HTML image tag using ASP.NET MVC. Please reopen it.
You can simply use something like following
<img src="@String.Format("data:image/png;base64,{0}", Convert.ToBase64String(Model.imageBytes))" />