Presentation is loading. Please wait.

Presentation is loading. Please wait.

CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group Microsoft Corporation.

Similar presentations


Presentation on theme: "CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group Microsoft Corporation."— Presentation transcript:

1 CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group Microsoft Corporation

2 M anagement T ools C ommunications & M essaging Device Update Agent Software Update Services Live Communications Server Exchange Server Internet Security and Acceleration Server Speech Server Image Update L ocation S ervices M ultimedia MapPoint DirectX Windows Media Visual Studio 2005 D evelopment T ools MFC 8.0, ATL 8.0 Win32 N ative M anaged S erver S ide L ightweight R elational SQL Server 2005 Express EditionEDB D ata P rogramming M odel D evice B uilding T ools D evice B uilding T ools H ardware/ D rivers Windows XP DDK Windows Embedded Studio Platform Builder OEM/IHV Supplied BSP (ARM, SH4, MIPS) OEM Hardware and Standard Drivers Standard PC Hardware and Drivers SQL Server 2005SQL Server 2005 Mobile Edition ASP.NET Mobile ControlsASP.NET.NET Compact Framework.NET Framework Microsoft Operations Manager Systems Management Server

3 Agenda Ink Defined Stroke Management Stroke Visuals Stroke Geometry Ink Persistence Extensibility

4 Ink Defined Packet data produced by the digitizer contains x,y data may contain additional data (such as pressure) Stroke Object series of packets collected during one pen down/move/up operation has DrawingAttributes (color, transparency, etc.) can be extended via ExtendedProperties contained by exactly one Ink object

5 Strokes Collection collection of references to Stroke objects defines common operations on groups of Stroke objects contained by exactly one Ink object can store recognition result Ink Object outermost entry point to the Ink data API container and owner of Stroke objects and Strokes collections can be extended via ExtendedProperties Ink Defined

6 Other Ink Data objects DrawingAttributes object Defines Stroke visuals ExtendedProperties collection Extends the ink object model CustomStrokes collection Collection of custom Strokes collections

7 Ink Explorer Things to focus on: Ink data object model Relationship between objects

8 Stroke Management Each Stroke has an ID that is unique within an Ink object Ink.Strokes is a collection of references to all strokes Create a new strokes collection using Ink.CreateStrokes You can also pass an array of stroke ids to pre-fill the collection

9 Stroke Management Removing a Stroke from a Strokes collection does not delete the Stroke – Still in the Ink.Strokes collection Need to use the Delete method to delete it from the Ink object If deleted Stroke is still referenced by a Strokes collection Stroke.Deleted is set to true

10 Stroke Object – Extracting Create a new ink object from existing Strokes Ink ink2 = ink1.ExtractStrokes(strokesA, CopyFromOriginal); Copy Strokes into a second ink object Ink2.AddStrokesAtRectangle(strokesA, rect); Note: strokesA is a Strokes collection off of Ink1

11 Extracting Strokes Things to focus on: Moving / copying strokes between different Ink objects

12 Recap Ink object contains Stroke objects Strokes references Stroke objects Stroke objects are not deleted if they are still referenced Pen interaction results in a stroke Stroke increments stroke ID Stroke objects can be moved/copied between Ink objects

13 Stroke Visuals Transform can Scale, Rotate, Translate Scroll stroke.Transform(matrix, boolApplyOnPenWidth); strokes.Transform(matrix, boolApplyOnPenWidth); Stroke visuals are changed via DrawingAttributes stroke.DrawingAttributes = drawingAttribute; strokes.ModifyDrawingAttributes(drawingAttribute);  AntiAliased  Color  FitToCurve  Height  IgnorePressure  PenTip  RasterOperation  Transparency  Width

14 Stroke Visual Overrides The Renderer class allows for visual overrides Using the Renderer APIs will not change the Ink data Renderer allows drawing to an arbitrary device context Renderer allows drawing with arbitrary DrawingAttributes Renderer allows applying an arbitrary Transform

15 Ink Visuals Things to focus on: Use of transformation Use of Drawing attributes Use of the Renderer

16 Recap Adjusting ink visuals is easy Transforms and DrawingAttributes define visuals Scope: Stroke, Strokes The Renderer class allows for visual overrides

17 Stroke Geometry Points and Cusps Bounding Box Intersections Hit Test Split and Trim

18 Retrieving Points Point is a coordinate inside a stroke Useful for custom drawing of ink or custom recognition Getting Polyline Points Point[] pts = stroke.GetPoints(iStart, ptCount); Setting Polyline Points stroke.SetPoints(iStart, pts); Bezier Control Points (get only) Point[] pts = stroke.BezierPoints;

19 Bounding Box Of A Stroke Smallest rectangle that encloses ink GetBoundingBox on Ink/Stroke/Strokes returns the bounding rectangle

20 Computing Cusps Cusps – Point on the stroke where Peaks, Angles, radical change in direction and end points 2 Types of Cusps PolylineCusps – indices of Polyline points Bezier – indices of Bezier points Useful for stroke segmentation for gesture reco or partial stroke erase

21 Computing Intersections Support for 3 categories of intersections float[] fpi = stroke.SelfIntersections; //Self intersection is the point in a stroke where the stroke crosses over itself float[] fpi = stroke.FindIntersections(strokes); StrokeIntersection[] si = stroke.GetRectangleIntersections( rcBounds);

22 Stroke Geometry Things to focus on: Set / Get Points Drawing BoundingBox Calculating Cusps Calculating Intersections

23 HitTesting Support for 3 categories of hittests Strokes strokes = ink.HitTest(point, fRadius); Radius from the point Strokes strokes = ink.HitTest(rectangle, fPercentage); Fpercentage – percentage of points in the lasso Strokes strokes = ink.HitTest(arrPoints, fPercentage);

24 Splitting And Trimming Ink Splitting is useful for custom point erase or partial stroke manipulation Trimming is useful to clip ink to a limited region Split Stroke stroke = stroke.Split(fpi); //fpi = floating point index of the split location Clippingink.Clip(rectangle);stroke.Clip(rectangle);strokes.Clip(rectangle);

25 Hit Test And Splitting

26 Persisting Ink Persistence APIs enable saving ink to files, databases, clipboard Ink object can be saved to a Byte array Persistence format can be ISF or GIF Persisted ink contains all ink data attributes (incl. ExtendedProperties and CustomStrokes)

27 Persisting Ink Save Ink object level information Byte[] arrData = ink.Save(); Save Strokes collection (e.g. selection) Byte[] arrData = ink.ExtractStrokes(myStrokes).Save(); Load an Ink object Ink ink = new Ink(); ink.Load(arrData);

28 Using The Clipboard Copy/Cut IDataObject ido = ink.ClipboardCopy(clipboardFormat, Copy); Paste Strokes strokes = ink.ClipboardPaste(point); Checking clipboard format bool fPasteOK = ink.CanPaste();

29 Enabling Drag-drop Call ClipboardCopy on Drag IDataObject ido = ink.ClipboardCopy(clipFormat, ExtractOnly); Call ClipboardPaste on Drop Strokes strokes = ink.ClipboardPaste(point, ido);

30 Ink Drag And Drop Things to focus on: Ink.Clipboard APIs in drag and drop events Interop with Windows Journal

31 Recap Ink can be persisted in Byte arrays Clipboard APIs are provided Implementing Drag drop is easy

32 Extensibility ExtendedProperties Collection generic extensibility mechanism GUID + value pair persisted with the ink data Applies to Stroke object Ink object DrawingAttributes object

33 Extensibility CustomStrokes Collection mechanism for persisting named custom Strokes collections collection of Strokes collections persisted with the ink data

34 Ink Extensibility Things to focus on: Use of ExtendedProperties Use of CustomStrokes Roundtrip/Interop with Ink-unaware apps

35 MEDC Mobile PC Talks CLI204 – Tablet PC Development Overview Speaker – Dave Hale Time – Tuesday 5/10 11:30 AM CLI208 – Anywhere Access to Data Speaker – Markus Egger Time – Tuesday 5/10 3:00 PM CLI324 – Advanced Tablet PC Development Topics Speaker – Todd Landstad Time – Wednesday 5/11 8:00 AM CLI205 – Basic Considerations for Mobile PC Development Speaker – Michelle McKelvey Time – Wednesday 5/11 11:30 AM CLI329 – Network Awareness Speaker – Dr. Neil Roodyn Time – Thursday 5/12 8:00 AM

36 Mobile Hands On Labs At MEDC Building Network-Aware Mobile PC Applications Build a network-aware application using the Windows Network Location Awareness (NLA) API Building Power-Aware Mobile PC Applications Learn how to tune your applications to save power, extend battery life, and enhance the user's mobile PC experience Building Managed Applications with Microsoft Windows XP Tablet PC SDK Create a cool Tablet application using the Windows XP Tablet PC Edition SDK 1.7

37 The Tablet and Mobile PC Developer Center http://msdn.microsoft.com/mobilepc http://msdn.microsoft.com/mobilepc

38 Mobile PC Developer Center The latest technical articles Downloads Developer resources Regular columns.Newsgroups Featured partners and more…

39 Attend a free chat or web cast http://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asp List of newsgroups http://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx MS Community Sites http://www.microsoft.com/communities/default.mspx Locate Local User Groups and Community Sites http://www.microsoft.com/communities/usergroups/default.mspx http://www.microsoft.com/communities/related/default.mspx

40 While at MEDC 2005… Fill out an evaluation for this session Randomly selected instant WIN prizes! Randomly selected instant WIN prizes! Use real technology in a lab Instructor led Reef E/F & Breakers L Self-paced Reef B/C Self-paced Reef B/C Visit the Microsoft Product Pavilion in the Exhibit Hall Shorelines B in the Exhibit Hall Shorelines B

41 After The Conference… Develop Build InstallBuildJoin Install Enter Enter Join Full-featured trial versions of Windows CE and/or Windows XP Embedded Cool stuff & tell us about it: msdn.microsoft.com/embedded/community msdn.microsoft.com/embedded/community Windows Embedded Partner Program: www.mswep.com www.mswep.com Windows Mobile 5.0 Eval Kit including Visual Studio 2005 Beta 2 Mobile2Market Contest and win up to $25000: mobile2marketcontest.com mobile2marketcontest.com Microsoft Solutions Partner Program: partner.microsoft.com partner.microsoft.com

42 Tools & Resources msdn.microsoft.com/ embedded microsoft.public. windowsxp.embedded windowsce.platbuilder windowsce.platbuilder windowsce.embedded.vc windowsce.embedded.vc blogs.msdn.com/ mikehall Windows CE 5.0 Eval Kit Windows XP Embedded Eval Kit msdn.microsoft.com/ mobility microsoft.public. pocketpc.developer smartphone.developer dotnet.framework.compactframework blogs.msdn.com/ windowsmobile vsdteam netcfteam Windows Mobile 5.0 Eval Kit Websites Newsgroups Blogs Tools Build Develop

43

44 © 2005 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group Microsoft Corporation."

Similar presentations


Ads by Google