Tablet PC Programming: Basics CSE481B Lecture 3 Craig Prince Jan 11. 2006
Outline Tablet PC UI Controls Ink and Strokes Ink Events Ink Data Format DrawingAttributes Class Ink Transformations Measuring and Modifying Strokes
Resources Tablet PC SDK “Building Tablet PC Applications” Latest v1.7 Installed on all machines Download from MS The SDK Help is Useful “Building Tablet PC Applications” Covers the basics Search the Web
4 UI Controls InkCollector – Basic InkOverlay – Adds selection, erasing, highlighting, etc. InkPicture – Draw ink on a picture InkEdit – Ink turned straight into text
Example
Ink and Strokes InkOverlay Ink Stroke Stroke Stroke Ink.Strokes InkOverlay.Selection
Ink Events Ink – InkAdded, InkDeleted InkCollector – All sorts of Events InkOverlay – All sorts of Events + More Easiest to explore them from the SDK docs
Example
Ink Data Format Series of Packets: Stroke.GetPacketData() X, Y, Pressure, etc. Example
DrawingAttributes See SDK
Ink Transformations Renderer class Does all the drawing of ink, uses the DrawingAttributes Draw() is most important Calling directly allows some neat effects
Aside: Two helpful functions InkSpaceToPixel PixelToInkSpace
Ink Transformations Set/GetObjectTransform Set/GetViewTransform Object View World Let’s see an example
Example
Measuring and Modifying Strokes GetBoundingBox HitTest (Rectangle, circle, or blob) NearestPoint (both Ink and Stroke) Strokes.Split(float) Clip (Ink, Strokes, and Stroke)
Coming Next Ink Recognition Real Time Stylus Text Recognition Gestures Custom Recognizers Real Time Stylus Few Differences When to Use