CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group...
-
Upload
emmeline-roxanne-hood -
Category
Documents
-
view
214 -
download
1
Transcript of CLI325 In Depth – Ink Data Management Mark Hopkins Programmer Writer Tablet and Mobile PC Group...
CLI325CLI325
In Depth – In Depth – Ink Data ManagementInk Data Management
Mark HopkinsMark HopkinsProgrammer WriterProgrammer WriterTablet and Mobile PC GroupTablet and Mobile PC GroupMicrosoft CorporationMicrosoft Corporation
MManagementanagementTToolsools
CCommunicationsommunications& & MMessagingessaging
Device Update Agent
Software Update Services
Live Communications Server
Exchange Server
Internet Security and Acceleration Server
Speech Server
Image Update
LLocation ocation SServiceservices
MMultimediaultimedia
MapPoint
DirectX
Windows Media
Visual Studio 2005DDevelopment evelopment TToolsools
MFC 8.0, ATL 8.0
Win32NNativeative
MManagedanaged
SServer erver SSideide
LLightweightightweight
RRelationalelationalSQL Server 2005 Express EditionEDB
DDa
taata
PPro
gra
mm
ing
ro
gra
mm
ing
MM
od
el
od
el
DDevice evice BBuilding uilding TToolsools
HHardware/ardware/DDriversrivers
Windows XP DDK
Windows Embedded Studio
Platform Builder
OEM/IHV SuppliedBSP
(ARM, SH4, MIPS)OEM Hardware and Standard Drivers
Standard PC Hardware and Drivers
SQL Server 2005SQL Server 2005 Mobile Edition
ASP.NET Mobile Controls ASP.NET
.NET Compact Framework .NET Framework
Microsoft Operations Manager
Systems Management Server
AgendaAgenda
Ink DefinedInk Defined
Stroke ManagementStroke Management
Stroke Visuals Stroke Visuals
Stroke GeometryStroke Geometry
Ink PersistenceInk Persistence
ExtensibilityExtensibility
Ink DefinedInk Defined
PacketPacketdata produced by the digitizerdata produced by the digitizer
contains x,y datacontains x,y data
may contain additional data (such as pressure)may contain additional data (such as pressure)
Stroke ObjectStroke Objectseries of packets collected during one pen series of packets collected during one pen down/move/up operationdown/move/up operation
has DrawingAttributes (color, transparency, etc.)has DrawingAttributes (color, transparency, etc.)
can be extended via ExtendedPropertiescan be extended via ExtendedProperties
contained by exactly one Ink objectcontained by exactly one Ink object
Strokes CollectionStrokes Collectioncollection of references to Stroke objectscollection of references to Stroke objectsdefines common operations on groups of defines common operations on groups of Stroke objectsStroke objectscontained by exactly one Ink objectcontained by exactly one Ink objectcan store recognition resultcan store recognition result
Ink ObjectInk Objectoutermost entry point to the Ink data APIoutermost entry point to the Ink data APIcontainer and owner of Stroke objects and container and owner of Stroke objects and Strokes collectionsStrokes collectionscan be extended via ExtendedPropertiescan be extended via ExtendedProperties
Ink DefinedInk Defined
Ink DefinedInk Defined
Other Ink Data objectsOther Ink Data objectsDrawingAttributes objectDrawingAttributes object
Defines Stroke visualsDefines Stroke visuals
ExtendedProperties collectionExtendedProperties collectionExtends the ink object modelExtends the ink object model
CustomStrokes collectionCustomStrokes collectionCollection of custom Strokes collectionsCollection of custom Strokes collections
Ink ExplorerInk Explorer
Things to focus on:Things to focus on:Ink data object modelInk data object model
Relationship between objectsRelationship between objects
Stroke ManagementStroke Management
Each Stroke has an ID that is unique Each Stroke has an ID that is unique within an Ink objectwithin an Ink object
Ink.Strokes is a collection of Ink.Strokes is a collection of references to all strokesreferences to all strokes
Create a new strokes collection using Create a new strokes collection using Ink.CreateStrokesInk.CreateStrokes
You can also pass an array of stroke ids You can also pass an array of stroke ids to pre-fill the collectionto pre-fill the collection
Stroke ManagementStroke Management
Removing a Stroke from a Strokes Removing a Stroke from a Strokes collection does not delete the Stroke – collection does not delete the Stroke – Still in the Ink.Strokes collectionStill in the Ink.Strokes collection
Need to use the Delete method to Need to use the Delete method to delete it from the Ink objectdelete it from the Ink object
If deleted Stroke is still referenced by a If deleted Stroke is still referenced by a Strokes collection Stroke.Deleted is set Strokes collection Stroke.Deleted is set to trueto true
Stroke Object – ExtractingStroke Object – Extracting
Create a new ink object from existing Create a new ink object from existing StrokesStrokes
Ink ink2 = ink1.ExtractStrokes(strokesA, Ink ink2 = ink1.ExtractStrokes(strokesA, CopyFromOriginal);CopyFromOriginal);
Copy Strokes into a second ink objectCopy Strokes into a second ink object
Ink2.AddStrokesAtRectangle(strokesA, Ink2.AddStrokesAtRectangle(strokesA, rect);rect);
Note: strokesA is a Strokes collection off of Ink1Note: strokesA is a Strokes collection off of Ink1
Extracting StrokesExtracting Strokes
Things to focus on:Things to focus on:Moving / copying strokes Moving / copying strokes between different Ink objectsbetween different Ink objects
RecapRecap
Ink object contains Stroke objectsInk object contains Stroke objects
Strokes references Stroke objectsStrokes references Stroke objects
Stroke objects are not deleted if they Stroke objects are not deleted if they are still referencedare still referenced
Pen interaction results in a strokePen interaction results in a stroke
Stroke increments stroke IDStroke increments stroke ID
Stroke objects can be moved/copied Stroke objects can be moved/copied between Ink objectsbetween Ink objects
Stroke VisualsStroke Visuals
Transform can Scale, Rotate, Translate Transform can Scale, Rotate, Translate ScrollScrollstroke.Transform(matrix, boolApplyOnPenWidth);
strokes.Transform(matrix, boolApplyOnPenWidth);
Stroke visuals are changed via Stroke visuals are changed via DrawingAttributes DrawingAttributes stroke.DrawingAttributes = drawingAttribute;stroke.DrawingAttributes = drawingAttribute;
strokes.ModifyDrawingAttributes(drawingAttribute);strokes.ModifyDrawingAttributes(drawingAttribute);
AntiAliasedAntiAliasedColorColorFitToCurveFitToCurveHeightHeight
IgnorePressureIgnorePressurePenTipPenTipRasterOperationRasterOperationTransparencyTransparency
WidthWidth
Stroke Visual OverridesStroke Visual Overrides
The Renderer class allows for The Renderer class allows for visual overridesvisual overrides
Using the Renderer APIs will Using the Renderer APIs will not not change the Ink datachange the Ink data
Renderer allows drawing to an Renderer allows drawing to an arbitrary device contextarbitrary device context
Renderer allows drawing with arbitrary Renderer allows drawing with arbitrary DrawingAttributesDrawingAttributes
Renderer allows applying an Renderer allows applying an arbitrary Transformarbitrary Transform
Ink VisualsInk Visuals
Things to focus on:Things to focus on:Use of transformationUse of transformation
Use of Drawing attributesUse of Drawing attributes
Use of the RendererUse of the Renderer
RecapRecap
Adjusting ink visuals is easyAdjusting ink visuals is easy
Transforms and DrawingAttributes Transforms and DrawingAttributes define visualsdefine visuals
Scope: Stroke, StrokesScope: Stroke, Strokes
The Renderer class allows for visual The Renderer class allows for visual overridesoverrides
Stroke GeometryStroke Geometry
Points and CuspsPoints and Cusps
Bounding BoxBounding Box
IntersectionsIntersections
Hit TestHit Test
Split and TrimSplit and Trim
Retrieving PointsRetrieving Points
Point is a coordinate inside a strokePoint is a coordinate inside a stroke
Useful for custom drawing of ink or custom Useful for custom drawing of ink or custom recognitionrecognition
Getting Polyline PointsGetting Polyline PointsPoint[] pts = stroke.GetPoints(iStart, ptCount);Point[] pts = stroke.GetPoints(iStart, ptCount);
Setting Polyline PointsSetting Polyline Pointsstroke.SetPoints(iStart, pts);stroke.SetPoints(iStart, pts);
Bezier Control Points (get only)Bezier Control Points (get only)Point[] pts = stroke.BezierPoints;Point[] pts = stroke.BezierPoints;
Bounding Box Of A StrokeBounding Box Of A Stroke
Smallest rectangle that encloses inkSmallest rectangle that encloses ink
GetBoundingBox on Ink/Stroke/Strokes GetBoundingBox on Ink/Stroke/Strokes returns the bounding rectanglereturns the bounding rectangle
Computing CuspsComputing Cusps
Cusps – Point on the stroke where Cusps – Point on the stroke where Peaks, Angles, radical change in Peaks, Angles, radical change in direction and end points direction and end points
2 Types of Cusps2 Types of CuspsPolylineCusps – indices of Polyline pointsPolylineCusps – indices of Polyline points
Bezier – indices of Bezier pointsBezier – indices of Bezier points
Useful for stroke segmentation for Useful for stroke segmentation for gesture reco or partial stroke erasegesture reco or partial stroke erase
Computing IntersectionsComputing Intersections
Support for 3 categories of intersectionsSupport for 3 categories of intersectionsfloat[] 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);
Stroke GeometryStroke Geometry
Things to focus on:Things to focus on:Set / Get Points Set / Get Points Drawing BoundingBoxDrawing BoundingBoxCalculating CuspsCalculating CuspsCalculating IntersectionsCalculating Intersections
HitTestingHitTesting
Support for 3 categories of hittestsSupport 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);
Splitting And Trimming InkSplitting And Trimming Ink
Splitting is useful for custom point Splitting is useful for custom point erase or partial stroke manipulationerase or partial stroke manipulation
Trimming is useful to clip ink to a Trimming is useful to clip ink to a limited regionlimited region
SplitSplitStroke stroke = stroke.Split(fpi);Stroke stroke = stroke.Split(fpi);
//fpi = floating point index of the split location//fpi = floating point index of the split location
ClippingClippingink.Clip(rectangle);ink.Clip(rectangle);
stroke.Clip(rectangle);stroke.Clip(rectangle);
strokes.Clip(rectangle);strokes.Clip(rectangle);
Hit Test And SplittingHit Test And Splitting
Persisting InkPersisting Ink
Persistence APIs enable saving ink to Persistence APIs enable saving ink to files, databases, clipboardfiles, databases, clipboard
Ink object can be saved to a Byte arrayInk object can be saved to a Byte array
Persistence format can be ISF or GIFPersistence format can be ISF or GIF
Persisted ink contains all ink data Persisted ink contains all ink data attributes (incl. ExtendedProperties attributes (incl. ExtendedProperties and CustomStrokes)and CustomStrokes)
Persisting InkPersisting Ink
Save Ink object level informationSave Ink object level informationByte[] arrData = ink.Save();Byte[] arrData = ink.Save();
Save Strokes collection (e.g. selection)Save Strokes collection (e.g. selection)Byte[] arrData = Byte[] arrData =
ink.ExtractStrokes(myStrokes).Save();ink.ExtractStrokes(myStrokes).Save();
Load an Ink objectLoad an Ink objectInk ink = new Ink();Ink ink = new Ink();
ink.Load(arrData);ink.Load(arrData);
Using The ClipboardUsing The Clipboard
Copy/CutCopy/CutIDataObject ido = IDataObject ido =
ink.ClipboardCopy(clipboardFormat, Copy);ink.ClipboardCopy(clipboardFormat, Copy);
PastePasteStrokes strokes =Strokes strokes =
ink.ClipboardPaste(point);ink.ClipboardPaste(point);
Checking clipboard formatChecking clipboard formatbool fPasteOK = ink.CanPaste();bool fPasteOK = ink.CanPaste();
Enabling Drag-dropEnabling Drag-drop
Call ClipboardCopy on DragCall ClipboardCopy on DragIDataObject ido = IDataObject ido =
ink.ClipboardCopy(clipFormat, ExtractOnly);ink.ClipboardCopy(clipFormat, ExtractOnly);
Call ClipboardPaste on DropCall ClipboardPaste on DropStrokes strokes =Strokes strokes =
ink.ClipboardPaste(point, ido);ink.ClipboardPaste(point, ido);
Ink Drag And DropInk Drag And Drop
Things to focus on:Things to focus on:Ink.Clipboard APIs in drag and Ink.Clipboard APIs in drag and drop eventsdrop eventsInterop with Windows JournalInterop with Windows Journal
RecapRecap
Ink can be persisted in Byte arraysInk can be persisted in Byte arrays
Clipboard APIs are providedClipboard APIs are provided
Implementing Drag drop is easyImplementing Drag drop is easy
ExtensibilityExtensibility
ExtendedProperties CollectionExtendedProperties Collectiongeneric extensibility mechanismgeneric extensibility mechanism
GUID + value pairGUID + value pair
persisted with the ink datapersisted with the ink data
Applies toApplies toStroke objectStroke object
Ink objectInk object
DrawingAttributes objectDrawingAttributes object
ExtensibilityExtensibility
CustomStrokes CollectionCustomStrokes Collectionmechanism for persisting named custom mechanism for persisting named custom Strokes collectionsStrokes collections
collection of Strokes collectionscollection of Strokes collections
persisted with the ink datapersisted with the ink data
Ink ExtensibilityInk Extensibility
Things to focus on:Things to focus on:Use of ExtendedPropertiesUse of ExtendedPropertiesUse of CustomStrokesUse of CustomStrokesRoundtrip/Interop with Roundtrip/Interop with Ink-unaware appsInk-unaware apps
MEDC Mobile PC TalksMEDC Mobile PC Talks
CLI204 – Tablet PC Development OverviewCLI204 – Tablet PC Development OverviewSpeaker – Dave HaleSpeaker – Dave Hale
Time – Tuesday 5/10 11:30 AMTime – Tuesday 5/10 11:30 AM
CLI208 – Anywhere Access to DataCLI208 – Anywhere Access to DataSpeaker – Markus EggerSpeaker – Markus Egger
Time – Tuesday 5/10 3:00 PMTime – Tuesday 5/10 3:00 PM
CLI324 – Advanced Tablet PC Development TopicsCLI324 – Advanced Tablet PC Development TopicsSpeaker – Todd LandstadSpeaker – Todd Landstad
Time – Wednesday 5/11 8:00 AMTime – Wednesday 5/11 8:00 AM
CLI205 – Basic Considerations for Mobile PC DevelopmentCLI205 – Basic Considerations for Mobile PC DevelopmentSpeaker – Michelle McKelveySpeaker – Michelle McKelvey
Time – Wednesday 5/11 11:30 AMTime – Wednesday 5/11 11:30 AM
CLI329 – Network AwarenessCLI329 – Network AwarenessSpeaker – Dr. Neil RoodynSpeaker – Dr. Neil Roodyn
Time – Thursday 5/12 8:00 AMTime – Thursday 5/12 8:00 AM
Mobile Hands On Labs Mobile Hands On Labs At MEDCAt MEDC
Building Network-Aware Mobile PC ApplicationsBuilding Network-Aware Mobile PC ApplicationsBuild a network-aware application using the Windows Build a network-aware application using the Windows Network Location Awareness (NLA) API Network Location Awareness (NLA) API
Building Power-Aware Mobile PC ApplicationsBuilding Power-Aware Mobile PC ApplicationsLearn how to tune your applications to save power, extend Learn how to tune your applications to save power, extend battery life, and enhance the user's mobile PC experience battery life, and enhance the user's mobile PC experience
Building Managed Applications with Microsoft Building Managed Applications with Microsoft Windows XP Tablet PC SDK Windows XP Tablet PC SDK
Create a cool Tablet application using the Windows XP Create a cool Tablet application using the Windows XP Tablet PC Edition SDK 1.7 Tablet PC Edition SDK 1.7
The Tablet and Mobile The Tablet and Mobile PC Developer CenterPC Developer Centerhttp://msdn.microsoft.com/mobilepchttp://msdn.microsoft.com/mobilepc
Mobile PC Developer CenterMobile PC Developer Center
The latest technical articlesThe latest technical articles
DownloadsDownloads
Developer resourcesDeveloper resources
Regular columnsRegular columns
..
NewsgroupsNewsgroups
Featured partnersFeatured partners
and more…and more…
Attend a free chat or web castAttend a free chat or web casthttp://www.microsoft.com/communities/chats/default.mspxhttp://www.microsoft.com/communities/chats/default.mspx http://www.microsoft.com/usa/webcasts/default.asphttp://www.microsoft.com/usa/webcasts/default.asp
List of newsgroupsList of newsgroupshttp://communities2.microsoft.com/communities/newsgroups/en-us/default.aspxhttp://communities2.microsoft.com/communities/newsgroups/en-us/default.aspx
MS Community SitesMS Community Siteshttp://www.microsoft.com/communities/default.mspx http://www.microsoft.com/communities/default.mspx
Locate Local User Groups and Community SitesLocate Local User Groups and Community Siteshttp://www.microsoft.com/communities/usergroups/default.mspx http://www.microsoft.com/communities/usergroups/default.mspx http://www.microsoft.com/communities/related/default.mspxhttp://www.microsoft.com/communities/related/default.mspx
While at MEDC 2005…While at MEDC 2005…Fill outFill out an evaluation for this session an evaluation for this session
Randomly selected instant Randomly selected instant WINWIN prizes! prizes!
Use Use real technology in a labreal technology in a lab Instructor led Instructor led Reef E/FReef E/F & & Breakers LBreakers L
Self-paced Self-paced Reef B/CReef B/C
VisitVisit the Microsoft Product Pavilion the Microsoft Product Pavilion
in the Exhibit Hall in the Exhibit Hall Shorelines BShorelines B
After The Conference…After The Conference…
DevelopDevelop
BuildBuild
InstallInstall
BuildBuild
JoinJoin
InstallInstall
EnterEnter
JoinJoin
Full-featured trial versions of Windows CE Full-featured trial versions of Windows CE and/or Windows XP Embeddedand/or Windows XP Embedded
Cool stuff & tell us about it: Cool stuff & tell us about it: msdn.microsoft.com/embedded/community msdn.microsoft.com/embedded/community
Windows Embedded Partner Program:Windows Embedded Partner Program:www.mswep.com www.mswep.com
Windows Mobile 5.0 Eval Kit including Windows Mobile 5.0 Eval Kit including Visual Studio 2005 Beta 2Visual Studio 2005 Beta 2
Mobile2Market Contest and win up to $25000: Mobile2Market Contest and win up to $25000: mobile2marketcontest.com mobile2marketcontest.com
Microsoft Solutions Partner Program:Microsoft Solutions Partner Program:partner.microsoft.com partner.microsoft.com
Tools & ResourcesTools & Resources
msdn.microsoft.com/msdn.microsoft.com/ embeddedembedded
microsoft.public.microsoft.public. windowsxp.embeddedwindowsxp.embedded windowsce.platbuilderwindowsce.platbuilder windowsce.embedded.vcwindowsce.embedded.vc
blogs.msdn.com/blogs.msdn.com/ mikehallmikehall
Windows CE 5.0 Eval KitWindows CE 5.0 Eval KitWindows XP Embedded Eval KitWindows XP Embedded Eval Kit
msdn.microsoft.com/msdn.microsoft.com/ mobilitymobility
microsoft.public.microsoft.public. pocketpc.developer pocketpc.developer smartphone.developer smartphone.developer dotnet.framework.compactframeworkdotnet.framework.compactframework
blogs.msdn.com/blogs.msdn.com/ windowsmobilewindowsmobile vsdteamvsdteam netcfteamnetcfteam
Windows Mobile 5.0 Eval KitWindows Mobile 5.0 Eval Kit
WebsitesWebsites
NewsgroupsNewsgroups
BlogsBlogs
ToolsTools
BuildBuild DevelopDevelop
© 2005 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.