How can I display ink (that is already captured) as an image in an ASP.NET page?

落花浮王杯 提交于 2019-12-12 03:48:42

问题


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.

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

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.

Please help, friends

EDIT: 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" />

回答1:


http://msdn.microsoft.com/en-us/library/aa515948.aspx

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



来源:https://stackoverflow.com/questions/3185875/how-can-i-display-ink-that-is-already-captured-as-an-image-in-an-asp-net-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!