Zesty
Zesty

Reputation: 2991

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

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

Upvotes: 0

Views: 1032

Answers (1)

ULysses
ULysses

Reputation: 978

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

Upvotes: 1

Related Questions