如何在MVC 4中渲染位图图像(使用C#.net)

时间:2015-10-01 11:44:09

标签: c# asp.net-mvc

有谁能告诉我如何将位图图像显示到cshtml页面?

控制器:

var sigToImg = new SignatureToImage();
var signatureImage = sigToImg.SigJsonToImage(surveyQuestionProxyViewModel.SurveyToolQuestionViewModel.UserSurveyAnswer.AnswerText);
surveyQuestionProxyViewModel.SurveyToolQuestionViewModel.UserSurveyAnswer.AnswerTextSig = signatureImage;

//signatureImage is System.drwaing.bitmap image

html = this.RenderViewToString(@"~/Views/PrintAsPdf/SurveyTool/_ExportSurveyToolQuestion.cshtml", surveyQuestionProxyViewModel);

现在我需要将surveyQuestionProxyViewModel.SurveyToolQuestionViewModel.UserSurveyAnswer.AnswerTextSig渲染到视图中,如下所示:

<div>
    <img src="@Model.SurveyToolQuestionViewModel.UserSurveyAnswer.AnswerTextSig" alt="Signature Image"/>
</div>

但是在运行时看不到任何内容。我该如何渲染呢。

0 个答案:

没有答案