最初にコントローラーでAjaxを使用して画像scrを更新しようとしています:
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 を使用して変数の 1 つを変更します。
$('#Zup').click(function () {
pointZF++;
// alert(pointZF);
$.ajax({
url: '/Home/GenerateMIPImage',
type: 'POST',
data: {
pX: pointXF,
pY: pointYF,
pZ: pointZF
},
success: function (data) {
dImage.src = data;
},
error: function () {
}
});
});
プロパティを確認すると、画像が消えます。
http://localhost:59601/�PNG
よろしくお願いします。