Sdílet prostřednictvím


InkCollector.Ink Property

Gets or sets the Ink object that is associated with the InkCollector object.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink (in Microsoft.Ink.dll)

Syntax

'Declaration
Public Property Ink As Ink
'Usage
Dim instance As InkCollector 
Dim value As Ink 

value = instance.Ink

instance.Ink = value
public Ink Ink { get; set; }
public:
property Ink^ Ink {
    Ink^ get ();
    void set (Ink^ value);
}
public function get Ink () : Ink 
public function set Ink (value : Ink)

Property Value

Type: Microsoft.Ink.Ink
The Ink object that is associated with the InkCollector object.

Remarks

Note

The InkCollector object must be disabled before setting this property. To disable the InkCollector object, set the Enabled property to false. You can then set the Ink property, and re-enable the InkCollector object by setting the Enabled property to true.

An InkCollector object creates an Ink object by default. If two or more Ink objects exist on a known application window, they can be switched out to enable collection into any one of them (such as after deserializing one of the Ink objects).

Examples

In this example, an InkCollector object works with multiple virtual pages by maintaining multiple Ink objects.

Before pages can be switched, an array of Ink objects is initialized.

mInkArrayCollector = New Ink(MAX_PAGE - 1) {}
For k As Integer = 0 To MAX_PAGE - 1
    mInkArrayCollector(k) = New Ink()
Next
mInkArrayCollector = new Ink[MAX_PAGE];
for (int k = 0; k < MAX_PAGE; k++)
{
    mInkArrayCollector[k] = new Ink();
}

Then, in response to a user action (such as picking from a menu or list), the Ink object of the InkCollector object is reassigned, and the control to which the InkCollector object is attached is redrawn.

Private Sub ChangeInkCollectorPage(ByVal PageNum As Integer)
    mInkCollector.Enabled = False
    mInkCollector.Ink = mInkArrayCollector(PageNum)
    mInkCollector.Enabled = True 
    ' Note: mInkCollector was instantiated via: new InkCollector(control) 
    ' not via: new InkCollector(control.Handle) - this .ctor does not set AttachedControl
    mInkCollector.AttachedControl.Invalidate()
End Sub
private void ChangeInkCollectorPage(int PageNum)
{
    mInkCollector.Enabled = false;
    mInkCollector.Ink = mInkArrayCollector[PageNum];
    mInkCollector.Enabled = true;
    // Note: mInkCollector was instantiated via: new InkCollector(control) 
    // not via: new InkCollector(control.Handle) - this .ctor does not set AttachedControl
    mInkCollector.AttachedControl.Invalidate();
}

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

InkCollector Class

InkCollector Members

Microsoft.Ink Namespace

InkCollector.Enabled

Ink