我想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