By definition img element src attribute must have a url that points to an image...
In your case you push into it some binary value but img try to interpret it as url - that the reason for the X (missing image) picture.
There is a non-standard, but mostly supported way of pushing binary data into img element, but in that case the format is a bit different...
<img src="data:image/jpeg;base64{binary data in base64}" />
---
I've never done it in MVC, but have a sample in WebForms, that may give you the direction...
public<pre> partial class Pic : Page
{
protected override void OnLoad ( EventArgs e )
{
byte[ ] bBuffer = File.ReadAllBytes( szPath );
Response.Clear( );
Response.Buffer = true;
Response.OutputStream.Write( bBuffer, 0, bBuffer.Length );
Response.Flush( );
Response.End( );</pre>
}
}
<!--
<img atl="me" src="Pic.aspx?path=me.jpg" />
It's can be done also without real files as long as you can get the binary content of the image, let say using memory stream or some sort of thing...