次の方法で共有


IXRStrokeCollection (Compact 2013)

3/28/2014

This class represents a collection of IXRStroke objects.

Syntax

class IXRStrokeCollection : public IXRDependencyObject

Inheritance Hierarchy

IXRDependencyObject

    IXRStrokeCollection

Methods

Method

Description

IXRStrokeCollection::Add

Adds an item to the end of this collection and retrieves the index of where it was added.

IXRStrokeCollection::Clear

Removes all items from this collection.

IXRStrokeCollection::Contains

Determines whether an item is in this collection.

IXRStrokeCollection::GetBounds

Returns the bounds of the strokes in this collection.

IXRStrokeCollection::GetCount

Retrieves the number of items in this collection.

IXRStrokeCollection::GetItem

Retrieves the item at the specified index in this collection.

IXRStrokeCollection::HitTest

Indicates whether a specified IXRStylusPointCollection object intersects with an IXRStrokeCollection object.

IXRStrokeCollection::IndexOf

Searches for the specified item and retrieves the zero-based index of its occurrence within this collection.

IXRStrokeCollection::Insert

Inserts an item into this collection at the location that has the specified index value.

IXRStrokeCollection::Remove

Removes a specific item from this collection.

IXRStrokeCollection::RemoveAt

Removes the item at the specified index from this collection.

Thread Safety

Members of this class are thread-safe if you previously called IXRApplication::CreateHostFromXaml and supplied it with an XRWindowCreateParams structure that has AllowsMultipleThreadAccess set to true. Allowing multiple-thread access can have a significant impact on application performance because this option serializes data for all objects in the collection across threads. If you have control over the lifetimes of these objects, it is recommended that you serialize only what is needed to achieve optimal performance.

Remarks

To enable a user to draw on the screen, for example by using a stylus, you must create an IXRInkPresenter object and position it on the graphical window. Ink is handwriting or drawing content that was input with a stylus, a mouse, or a gesture. This IXRInkPresenter object captures ink input in IXRStroke objects. These objects are stored in IXRStrokeCollection.

To obtain a pointer to this collection, call IXRInkPresenter::GetStrokes. Then, use the methods of this class to add, remove, or retrieve items. To clear the complete collection, call the IXRStrokeCollection::Clear method.

When you create a class instance, use an IXRStrokeCollectionPtr smart pointer instead of a raw interface pointer. For more information, see XRPtr<Interface>.

You can define a stroke collection in Microsoft Silverlight 3 XAML. For information on the differences between XAML in XAML for Windows Embedded and Silverlight 3, see Differences Between Microsoft Silverlight 3 and XAML for Windows Embedded. For more information about how to define this collection in the source XAML for your application, see the InkPresenter::Strokes Property on MSDN.

.NET Framework Equivalent

System.Windows.Ink.StrokeCollection

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

Classes for Collection Management
IXRInkPresenter::GetStrokes
IXRInkPresenter::SetStrokes