Persisting Ink on InkPicture

Hello fellow Ink Developers,

I am doing a project where I have an InkPicture control. It is used to obtain signatures from several members of a team. I found a site that says it is not possible to reload saved ink into one of these controls:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tpcsdk10/lonestar/Microsoft.Ink/Classes/ink/Methods/load.asp. Is there a workaround for this? I got the ink data to save as a byte array but I would like to be able to display it back to the user at some point using the same control. Is there a way to do this or do I have to save the ink as an image or something and display it through another control (like a picturebox, but I would not be able to allow the user to edit the signature stored in the InkPicture. Also note that I'm not concerned at all with ink recognition or displaying the information as text, just the picture of the signature.

Thank you very much for any advice you could provide.

[1270 byte] By [technoTABLET] at [2008-2-23]
# 1

Hello technoTABLET,

loading persisted ink into an exisiting InkPicture control is certainly an important and supported scenario for our platform. Here is how you do it:

Ink newInk = new Ink();

newInk.Load(inkBytes);

inkPicture1.InkEnabled = false;

inkPicture1.Ink = newInk;

inkPicture1.InkEnabled = true;

Two important things to remember here:

1) You can only load ink into a new Ink object. That's why my code creates "newInk" and assigns that to the InkPicture.

2) You can only assign an Ink object to the InkPicture when it is not ink-enabled. That's why my code sets "InkEnabled=false" temporarily.

Hope this helps.

Thanks, Stefan Wick

StefanWick-MSFT at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Notebook, Tablet PC, and UMPC Development...
# 2

Thank you very much for your help. The website I was looking at created a bunch of confusion for me, so you can display ink in an old inkpicture control. That is neat.

Thanks again Stefan,

technoTABLET at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Notebook, Tablet PC, and UMPC Development...

Software Development for Windows Vista

Site Classified