本文介绍了如何在ASP.NET页面中显示墨迹(已捕获)作为图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET Windows应用程序,它使用Microsoft Tablet PC SDK中的Microsoft.Ink收集墨迹并将其存储在数据库中。这很好。

I have a .NET windows application that collects ink using Microsoft.Ink from Microsoft Tablet PC SDK and stores it in a database. That's working fine.

现在我需要在ASP.NET应用程序中将此墨迹显示为图像。

Now I need to display this ink as an image in an ASP.NET application.

请注意,我不需要在Web应用程序中捕获任何笔划。只需将已捕获的笔划显示为图像。我不知道该怎么办。我想我不能在网页中使用Renderer.Draw。

Note that I don't need to capture any strokes in the web application. Just display the already captured strokes as an image. I don't know how to proceed. I think I can't use Renderer.Draw in a web page.

请帮助,朋友

编辑: 谢谢您的帮助。以下是任何人需要的示例代码:

Thanks for the help. Here's the sample code if anybody needs it:

        Response.Clear();
        Response.ContentType = "image/jpeg";
        Byte[] isf = Convert.FromBase64String("AI8BHQS6AoQBAwRIEEU1CoABNofwCMeAU9BIREIpEoZCoJpCdyGDxCUYCi8ZicV3rFIRAILEchwGGx/MEQgkD1FBoIyBBoJAoFN53LY/EYPU4LAwh+sa6m2HwCLSacReHwGDatQ2Qy2f4PkMVhcB4FiSxWARSVbmiMHguyYfBYFdSESWNSSZTySRaQSqbUCjwYA="); // Sample
        ink.Load(isf);
        Byte[] imageData = ink.Save(PersistenceFormat.Gif);
        Response.BinaryWrite(imageData);
        Response.End();

以下是显示页面中的图片代码:

Here's the image tag in the page to display it:

    <img alt="" src="RenderImage.aspx" />


推荐答案

您是否可以将墨水对象序列化为此格式?在这种情况下,您只需将其视为您网站上的图像,同时仍可选择将其反序列化为另一个Ink类实例

Is it possible that you serialize your ink object to this format? In this case you will just treat it as an image on your website, while still having an option of deserializating it into another instance of Ink class

这篇关于如何在ASP.NET页面中显示墨迹(已捕获)作为图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 09:36