Inking on your Windows Mobile Device
While at MEDC I had the chance to present a new addition to the Windows Mobile APIs: WISP Lite
WISP stands for Windows Ink Service Platform and it is the technology for ink recoginition used in other platforms like Tablet PC. In the Windows Mobile 6 SDK Help, it is referred to as Windows Mobile Ink. Even though WISP Lit is just a subset of WISP, it aligns Windows Mobile with the rest of Microsoft. WISP Lite will eventually replace our current rick ink control.
I played with it a little bit, and found out that adding simple ink recognition was not as hard as I expected.
These are the steps that allow you to recognize ink on a given window.
1. Create a Window where input will be recognized as ink. Something like the lines below would do the job. Nothing special about the window, except it is big enough for someone to scribble something.
// Create the signature window
hWndInk = CreateWindow( TEXT("static"),
NULL,
WS_VISIBLE | WS_CHILD | WS_BORDER,
left,
top + 20,
215,
150,
hWnd,
NULL,
hInstance,
NULL);
2. Attach an InkOverlay object to that window and enable it.
hr = ::CoCreateInstance(CLSID_InkOverlay,
NULL,
CLSCTX_INPROC_SERVER,
IID_IInkOverlay,
(void **)&g_pInkOverlay);
ASSERT(SUCCEEDED(hr));
hr = g_pInkOverlay->put_hWnd((long)hWndInk);
ASSERT(SUCCEEDED(hr));
hr = g_pInkOverlay->put_Enabled(VARIANT_TRUE);
ASSERT(SUCCEEDED(hr));
3. Let the user write something on your window.
4. When you are ready to recognize ink: Get the strokes (or dots recognized) and convert the strokes to a string.
g_pInkOverlay->get_Ink( &pInk );
// Get all the strokes in the ink object
pInk->get_Strokes(&pStrokes);
// Get the recognition result for these strokes
pStrokes->ToString(&resultString);
5. And voila! resultString now contains the recognized result.
A few samples that use WISP are shipped with the Windows Mobile 6 SDK. On my machine they installed to \Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CPP\win32\WISPLite
Luis Cabrera
Comments
Anonymous
June 12, 2007
Any chance there's a managed API for this? That C++ stuff makes my brain hurt.Anonymous
June 12, 2007
Unfortunately there is no WM6 managed API for this. I understand you pain. :) The good news is that when we do have a managed API for this it will most likely be a subset of the managed desktop inking APIs.Anonymous
June 28, 2007
The comment has been removedAnonymous
July 04, 2007
Hi, Does WSIP Lite support recognition of international characters like the special scandinavian characters Æ,Ø,Å,Ä,Ö ? MagneAnonymous
July 10, 2007
I heard that Microsoft was working on Deepfish mobile browser. Have you guys checked out Picsel Browser? It works on Windows mobile and is awesome (much better than pocket IE). There is no retail version available on their website (they sell it to OEM) but I found a copy in a user forum and tried it on WM5. Reminded me of the iPhone browser and has similar touch interface and zooming capabilities. I think Microsoft should buy that company and acquire its patent. Here is their website: http://www.picsel.com/index.php/solutions/view/C11/ (I am not affiliated with this company whatsoever)Anonymous
August 07, 2007
Does WISP Lite support gestures, like the Tablet PC's pen flicks?Anonymous
August 09, 2007
Could you push this towards the OneNote team - to have true inking for OneNote Mobile that I could leave as ink on devices like the Advantage would be very usefulAnonymous
September 14, 2007
Hi. I'm having problems with ClipboardCopy and ClipboardPaste methods from the IInkDisp interface. When I call the ClipboardCopy method it seems to be working fine since it returns S_OK. But when I call the ClipboardPaste method it does not work. It always returns E_POINTER or E_FAIL. I've tried with InkNotes sample but it is not working (I mean the copy/paste feature). The rest is working just fine. Besides it makes use of InkCanvas control and I'm trying directly with COM. What should I do? I'm working with the windows mobile 6 classic emulator. Thanks. Bye.Anonymous
October 18, 2007
Is this functionality available in Windows CE 5 or 6? Thanks.Anonymous
September 18, 2008
So do we get ink recognition on WM6 notes?Anonymous
January 28, 2009
I tried the sample application with the Windows Mobile 6 SDK. It works on the English emulators, but not on the Dutch version. Can I use inking on non-english installations? If so, how?Anonymous
April 20, 2009
I run basicRecogintion sample. But it returned fail on my P6350 device. hr = pStrokes->get_RecognitionResult(&result); Why?