Tablet PC App Development
I was recently tasked with developing a utility for Tablet PC - this utility will let users sign using pen/ink and store the signature as an image file. Trust me, I have not even touched a tablet PC before (shameful!) and thinking about writing a utility, be it .NET or non-.NET looked as a big task.
Anyway, I decided to get my hands dirty and started searching MSDN to see what I need to do tablet PC development using .NET. Apparently what I all needed was just a 15MB file - Microsoft Windows XP Tablet PC Edition Development Kit (ver 1.7), thats it -I don't even need a tablet PC (mouse can be substituted for the pen!).
After running through few articles through some googling and the SDK documentation, things became not at all complicated. All it took to accomplish the task - giving a ink surface to let the user sign using the pen and saving it as a file - was just less than 10 lines of code!
using Microsoft.Ink;
//...
InkOverlay InkOverlay1 = new InkOverlay(Panel1.Handle, true);
InkOverlay1.Enabled = true;
byte[] signData = InkOverlay1.Ink.Save(PersistenceFormat.Gif, CompressionMode.Maximum);
FileStream signFileStream = new FileStream(@"C:\SignImage.gif", FileMode.Create);
signFileStream.Write(signData, 0, signData.Length);
signFileStream.Close();
I've attached the utility screenshot and the saved file. Power and productivity of of .NET!!