Building Tablet PC Applications ROB JARRETT

Building Tablet PC Applications

ROB JARRETT

Tablet PC 开发,有需要PDF的留下邮箱

 

目录
This text was added by using code.Building Tablet PC Applications......................................1
ROB JARRETT ...............................................................................................................1
PHILIP SU......................................................................................................................1
Chapter 3. Introduction to the Tablet PC Platform SDK.....................................................9
A Sort of Homecoming .............................................................................................................10
Finding the Right Operating System for the Job.......................................................17
Managed APIs .....................................................................................................................18
Ink Controls .........................................................................................................................20
COM Automation APIs ......................................................................................................21
Sample Applications .........................................................................................................23
Installing the Tablet PC Platform SDK..................................................................................26
System Requirements.......................................................................................................27
Getting the SDK..................................................................................................................28
Setting Up Your Environment.........................................................................................29
SETTING UP YOUR VISUAL STUDIO .NET ENVIRONMENT ..............31
NOTE .............................................................................................................................31
Anatomy of the Tablet PC Platform SDK .....................................................................37
NOTE .............................................................................................................................37
Overview of the Managed API.................................................................................................40
All That You Can’t Leave Behind ...................................................................................45
Design Goals of the API ...................................................................................................46
THE PRIME DIRECTIVE .......................................................................................49
WHAT’S COVERED BY THE MANAGED API..............................................49
WHAT’S NOT COVERED BY THE MANAGED API ...................................52
NOTE .............................................................................................................................54
Managed API Object Survey............................................................................................58
TABLET INPUT API................................................................................................59
Ink Data Management API................................................................................................64
Ink Recognition API...........................................................................................................67
Ink Control Comparison with Managed API ........................................................................70
Welcome to the Great Adventure...........................................................................................74
Chapter 4. Tablet PC Platform SDK: Tablet Input..............................................................75
Sample Applications .................................................................................................................76
Capturing Input from the Pen .................................................................................................77
NOTE .............................................................................................................................77
Requirement #1—Mouse Emulation..............................................................................78
NOTE .............................................................................................................................78
Requirement #2—Digital Ink............................................................................................79
Requirement #3—Pen-Based Actions ..........................................................................81
3 / 891
NOTE .............................................................................................................................82
Summing Up the Requirements .....................................................................................83
.Anatomy of the Tablet PC’s Tablet Input Subsystem......................................................83
Tablet Hardware..................................................................................................................85
NOTE .............................................................................................................................86
Chock-full of HID-y Goodness ........................................................................................86
NOTE .............................................................................................................................87
The Center of the TIS Universe: Wisptis.exe ..............................................................88
NOTE .............................................................................................................................89
GETTING INPUT FROM THE DRIVER............................................................90
PERFORMING MOUSE EMULATION ..............................................................91
DETECTING PEN-BASED ACTIONS ..............................................................96
NOTE .............................................................................................................................97
DISPATCHING EVENTS .......................................................................................98
MAKING SENSE OF IT ALL .............................................................................101
Winlogon Desktop Support ...........................................................................................103
What About Ink?...............................................................................................................104
Platform SDK Support for Tablet Input ..............................................................................104
Getting Ink from a Tablet................................................................................................105
SAY HELLO TO THE INKCOLLECTOR .......................................................105
NOTE ...........................................................................................................................106
SAMPLE APPLICATION: "HELLOINKCOLLECTOR"............................106
NOTE ...........................................................................................................................110
When Ink Is Not Enough.................................................................................................111
NOTE ...........................................................................................................................112
SAMPLE APPLICATION: HELLOINKOVERLAY ......................................113
CHANGING THE ERASER MODE ..................................................................122
THE INKCONTROL CLASS IN
THE BUILDINGTABLETAPPS LIBRARY ....................................................123
INKOVERLAY’S ATTACH MODE ...................................................................124
NOTE ...........................................................................................................................126
NOTE ...........................................................................................................................127
InkCollector Events .........................................................................................................127
NOTE ...........................................................................................................................128
INK STROKE EVENTS ........................................................................................129
PEN MOVEMENT EVENTS ................................................................................130
NOTE ...........................................................................................................................135
MOUSE TRIGGER EVENTS ..............................................................................135
TABLET HARDWARE EVENTS .......................................................................137
NOTE ...........................................................................................................................137
RENDERING EVENTS (INKOVERLAY ONLY) ..........................................138
INK EDITING EVENTS (INKOVERLAY ONLY) .........................................139
SAMPLE APPLICATION: INPUTWATCHER ..............................................143
ANALYZING THE EVENTS................................................................................166
4 / 891
TIP ................................................................................................................................170
InkOverlay Events............................................................................................................173
Specifying the Tablet Data to Capture—Packet Properties ..................................174
TIP ................................................................................................................................175
SAMPLE APPLICATION: PACKETPROPERTYWATCHER .................180
TIP ................................................................................................................................180
INK COORDINATES .............................................................................................198
Extending InkOverlay Behaviors .................................................................................198
Sample Application: TopOfPenErase .........................................................................200
Sample Application: ModelessSwitch ........................................................................207
Getting Introspective...............................................................................................................213
Tablets Collection ............................................................................................................214
Tablet Class .......................................................................................................................215
SAMPLE APPLICATION: DEVICEWALKER ..............................................218
Common Properties on InkCollector and InkOverlay.............................................227
Best Practices for InkCollector and InkOverlay...............................................................232
NewPackets and NewInAirPackets Events................................................................232
Choosing Desired Packet Properties..........................................................................233
Gesture Recognition .......................................................................................................233
Mouse Events....................................................................................................................234
Summary ....................................................................................................................................235
Chapter 5. Tablet PC Platform SDK: Ink Data Management, Part I .............................236
Ink and Stroke Objects ...........................................................................................................238
NOTE ...........................................................................................................................239
Introduction to the Ink, Stroke, and Strokes Classes.............................................242
THE INK CLASS ....................................................................................................243
THE STROKE CLASS ..........................................................................................245
THE STROKES CLASS .......................................................................................246
SAMPLE APPLICATION—STROKEIDVIEWER ........................................248
ANALYSIS OF STROKE ID BEHAVIOR ......................................................258
NOTE ...........................................................................................................................260
Using Strokes Collections .............................................................................................260
COLLECTION FUNCTIONALITY .....................................................................261
RECEIVING NOTIFICATION OF STROKE ADDITION OR REMOVAL
.......................................................................................................................................263
SAMPLE APPLICATION—INKSELECTOR .................................................264
Creation, Deletion, and Ownership of Stroke Objects ...........................................276
ADDING INK ............................................................................................................278
NOTE ...........................................................................................................................279
DELETING INK .......................................................................................................280
RECEIVING NOTIFICATION OF INK ADDITION AND DELETION ...283
SAMPLE APPLICATION—INKCOPY ............................................................284
SAMPLE APPLICATION—INKFACTORY....................................................294
Rendering Digital Ink...............................................................................................................304
5 / 891
Renderer Class .................................................................................................................305
CREATING AND MAINTAINING RENDERER OBJECTS .....................307
DRAWING INK ........................................................................................................308
SAMPLE APPLICATION—INKLAYERS .......................................................309
CONVERTING BETWEEN INK SPACE AND PIXELS ............................317
RENDERER TRANSFORMS—SCROLLING AND ZOOMING ..............318
SAMPLE APPLICATION—INKMAGNIFY ....................................................323
Adding Style—The DrawingAttributes Class............................................................339
ANTIALIASED.........................................................................................................342
FITTOCURVE PROPERTY.................................................................................343
NOTE ...........................................................................................................................345
IGNOREPRESSURE PROPERTY ...................................................................345
PENTIP ATTRIBUTE ............................................................................................346
RASTEROPERATION PROPERTY.................................................................347
USING THE DRAWINGATTRIBUTES PROPERTY ..................................348
NOTE ...........................................................................................................................348
SAMPLE APPLICATION—INKFORMATTER .............................................351
Special Rendering Effects .............................................................................................369
RENDERING SELECTION STATE..................................................................370
GLOWING INK ........................................................................................................373
TRULY TRANSPARENT INK ............................................................................375
PERFORMANCE IMPLICATIONS OF THESE METHODS ....................375
Summary ....................................................................................................................................376
Chapter 6. Tablet PC Platform SDK: Ink Data Management, Part II ............................378
Stroke Geometry ......................................................................................................................379
Computing the Bounding Box of a Stroke ................................................................379
THE GETBOUNDINGBOX METHOD..............................................................380
THE RENDERER CLASS’S MEASURE METHOD....................................383
CODE SNIPPET—DRAWBOUNDINGBOXES ............................................384
Retrieving the Points of a Stroke .................................................................................385
POLYLINE POINTS ..............................................................................................386
NOTE ...........................................................................................................................387
BÉZIER CONTROL POINTS .............................................................................387
CODE SNIPPET—DRAWPOINTS (DRAWS BÉZIER OR POLYLINE
POINTS OF INK) ....................................................................................................389
Computing Intersections of a Stroke..........................................................................391
CODE SNIPPET—DRAWINTERSECTIONS ................................................397
Retrieving and Setting the Packet Data of a Stroke................................................403
NOTE ...........................................................................................................................404
CODE SNIPPET—PRESSUREADJUST .......................................................406
Retrieving the Cusps of a Stroke .................................................................................408
CODE SNIPPET—DRAWCUSPS.....................................................................409
Putting It Together—the StrokeDataViewer Example.............................................412
SAMPLE APPLICATION—STROKEDATAVIEWER.................................412
6 / 891
Transforming Strokes .....................................................................................................433
SAMPLE APPLICATION—STROKEWARPER ...........................................436
Targeting and Hit-Testing Ink Strokes................................................................................444
Different Types of Hit-Testing.......................................................................................444
POINT-BASED ........................................................................................................445
RECTANGLE-BASED ..........................................................................................445
LASSO-BASED ......................................................................................................446
PERCENTAGE-BASED ENCLOSURE ..........................................................446
Hit-Testing Functions......................................................................................................450
NOTE ...........................................................................................................................451
COMPUTING THE NEAREST POINT ............................................................452
SAMPLE APPLICATION—INSERTREMOVESPACE ..............................453
SAMPLE APPLICATION—REALTIMELASSO ...........................................466
Splitting and Trimming Ink ....................................................................................................499
Splitting Strokes...............................................................................................................500
NOTE ...........................................................................................................................501
Clipping/Trimming Strokes............................................................................................501
SAMPLE APPLICATION—STROKECHOPPER.........................................502
NOTE ...........................................................................................................................522
NOTE ...........................................................................................................................524
Serialization, the Clipboard, and Drag and Drop .............................................................524
Serialization .......................................................................................................................524
PERSISTING STROKES COLLECTIONS ....................................................529
EXTENDED PROPERTY DATA .......................................................................530
SAMPLE APPLICATION—INKPERSIST ......................................................531
NOTE ...........................................................................................................................541
Using the Clipboard.........................................................................................................541
SAMPLE APPLICATION—INKCLIPPY.........................................................547
Implementing Drag and Drop........................................................................................555
SAMPLE APPLICATION—INKDRAGDROP ...............................................556
Summary ....................................................................................................................................563
Chapter 7. Tablet PC Platform SDK: Ink Recognition.....................................................564
Recognizer Architecture ........................................................................................................566
Text vs. Object Recognition ..........................................................................................567
Synchronous vs. Asynchronous Recognition .........................................................568
PARTIAL RECOGNITION ...................................................................................570
WHEN TO USE FOREGROUND AND BACKGROUND RECOGNITION
.......................................................................................................................................571
Recognition Results........................................................................................................572
Performing Simple Recognition...........................................................................................574
Recognizing Text..............................................................................................................575
SAMPLE APPLICATION—BASICRECO ......................................................575
Recognizing Application Gestures..............................................................................580
SPECIFYING APPLICATION GESTURES TO RECOGNIZE................581
7 / 891
RECEIVING APPLICATION GESTURE EVENTS .....................................593
SAMPLE APPLICATION—GESTUREPAD ..................................................594
Using the Recognition Classes ............................................................................................606
Obtaining a Recognizer to Use.....................................................................................608
Initiating a Recognition Session ..................................................................................610
THE RECOGNITION MODE...............................................................................611
PREFIX AND SUFFIX STRINGS .....................................................................614
THE CHARACTER AUTO-COMPLETE MODE ..........................................614
NOTE ...........................................................................................................................616
Supplying Strokes to the Recognizer .........................................................................617
Getting Results I: Easy Synchronous Recognition.................................................620
NOTE ...........................................................................................................................621
SAMPLE APPLICATION—INTERMEDIATERECO...................................621
Getting Results II: Electric Boogaloo (a.k.a. Harder Synchronous Recognition)
..............................................................................................................................................627
SAMPLE APPLICATION—ADVANCEDRECO ...........................................628
NOTE ...........................................................................................................................641
Getting Results III: The Final Chapter (a.k.a. Asynchronous Recognition)......642
SAMPLE APPLICATION—ASYNCRECO.....................................................644
Working with Recognition Results..............................................................................655
THE RECOGNITIONALTERNATE CLASS ..................................................657
SAMPLE APPLICATION—WORDSELECT .................................................662
SAMPLE APPLICATION—CORRECTIONUI ..............................................675
Storing Recognition Results .........................................................................................695
Recognition Properties...................................................................................................698
Improving Recognition Results....................................................................................703
FACTOIDS—CONTENT HINT...........................................................................703
WORD LISTS—CONTENT HINT .....................................................................712
DETERMINING IF A WORD IS SUPPORTED ............................................712
GUIDES—SPATIAL HINT...................................................................................713
Summary ....................................................................................................................................714
Chapter 8. Ink Controls...........................................................................................................716
Achtung Baby ...........................................................................................................................717
IMPORTANT .............................................................................................................719
InkEdit .........................................................................................................................................720
InkEdit Basics ...................................................................................................................721
BASIC PROPERTIES ...........................................................................................728
MOUSE-RELATED PROPERTIES ..................................................................733
NOTE ...........................................................................................................................734
BASIC PROPERTIES EXAMPLE ....................................................................736
Working with Ink...............................................................................................................742
ACCESSING INK WITH SELINKS ..................................................................742
TOGGLING INK DISPLAY WITH SELINKSDISPLAYMODE ................744
Recognizing Ink and Gestures .....................................................................................746
8 / 891
CHANGING RECOGNITION ..............................................................................746
RECOGNITION TIMING ......................................................................................752
GESTURES IN INKEDIT .....................................................................................756
NOTE ...........................................................................................................................763
InkEdit Parting Thoughts ...............................................................................................763
InkPicture ...................................................................................................................................767
NOTE ...........................................................................................................................768
Summary ....................................................................................................................................783
Part III. Advanced Tablet PC Topics ........................................................................................785
Chapter 9. Updating Existing Applications .......................................................................785
Even Better than the Real Thing ..........................................................................................786
User Benefits of Integration ..........................................................................................787
PEN-FRIENDLY USER INTERFACES...........................................................787
DIGITAL INK FEATURES ..................................................................................790
Business Benefits of Integration .................................................................................793
Technical Considerations ......................................................................................................795
Application Design ..........................................................................................................795
INKCOLLECTOR AND INKOVERLAY ..........................................................796
STORAGE .................................................................................................................798
CLIPBOARD ............................................................................................................801
NOTE ...........................................................................................................................802
UNDO..........................................................................................................................803
INK ARCHITECTURE...........................................................................................809
ACCESSIBILITY.....................................................................................................811
Performance ......................................................................................................................812
SPEED OF COMMON OPERATIONS ............................................................813
NOTE ...........................................................................................................................833
MEMORY AND STORAGE OF INK ................................................................841
NOTE ...........................................................................................................................842
NOTE ...........................................................................................................................850
InkPadJunior .............................................................................................................................855
Summary ....................................................................................................................................867
Part IV. Appendixes....................................................................................................................868
Appendix A. BuildingTabletApps Library Reference......................................................868
The InkInputPanel Class ........................................................................................................870
InkInputPanel ....................................................................................................................870
The InkControl and InkControl2 Classes...........................................................................870
NOTE ...........................................................................................................................871
InkControl...........................................................................................................................871
InkControl2 ........................................................................................................................871
InkOverlay ..........................................................................................................................872
InkInputPanel ....................................................................................................................872
The FormatInkDlg Class.........................................................................................................872
FormatInkDlg.....................................................................................................................873
9 / 891
DrawingAttributes ............................................................................................................873
Add NoteThe InkEx Class.........................................................................................................874
AddStrokesAtRectangle.................................................................................................874
The RendererEx Class ............................................................................................................874
InkSpaceToPixel...............................................................................................................875
PixelToInkSpace...............................................................................................................875
DrawSelected ....................................................................................................................875
DrawStrokeIds...................................................................................................................876
DrawBoundingBoxes ......................................................................................................876
DrawPoints.........................................................................................................................877
DrawIntersections............................................................................................................878
DrawCusps.........................................................................................................................879
The LassoUI Class ...................................................................................................................879
LassoUI...............................................................................................................................880
Start .....................................................................................................................................880
Continue .............................................................................................................................881
Render.................................................................................................................................881
Points ..................................................................................................................................881
BoundingRect ...................................................................................................................882
DotSpacing ........................................................................................................................882
DotSize................................................................................................................................882
DotBrush ............................................................................................................................883
The CopyAsTextDlg Class.....................................................................................................883
CopyAsTextDlg.................................................................................................................883
RecognitionResult ...........................................................................................................884
Appendix B. Tablet PC Hardware Guidelines ...................................................................884
Windows XP Tablet PC Edition Hardware Requirements..............................................885
Digitizer: .............................................................................................................................885
Power States: ....................................................................................................................887
Viewing Mode:...................................................................................................................889
Removal from Dock:........................................................................................................890
Legacy-Free:......................................................................................................................890
CTRL+ALT+DEL or Equivalent Functionality: ..........................................................891

posted @ 2017-03-31 17:00  dozeoo  阅读(315)  评论(3编辑  收藏  举报