我想SCR使用Ajax更新的图像,首先在controllor:asp.net MVC - 阿贾克斯更新图像
public ActionResult GenerateMIPImage(float pX = 0, float pY = 0, float pZ = 0)
{
FileContentResult result;
...
im.SetViewPlane(new Point3D(pX, pY, pZ), new Vector3D(0, 0, 1), new Vector3D(0, 1, 0));
...
objImage = im.Bitmap(outputSize, PixelFormat.Format24bppRgb, m);
using (var memStream = new MemoryStream())
{
objImage.Save(memStream, ImageFormat.Png);
result = this.File(memStream.GetBuffer(), "image/png");
}
return result;
}
我第一次显示使用图像:
<img src='<%=Url.Action("GenerateMIPImage")%>' alt="" id="dImage"/>
然后我用这Ajax来改变的变量之一:
图像disapear,当检查其属性,我得到:
http://localhost:59601/�PNG
我很感谢您的建议,在此先感谢。
太谢谢你了穆萨的伟大工程。 – hncl 2013-04-21 16:13:09