ExtractStrokes() Method

ExtractStrokes() Method

Extracts strokes from an InkDisp object and cuts or copies them into a new InkDisp object, by using the known InkStrokes collection to determine which strokes to extract.

Declaration

[C++]

HRESULT ExtractStrokes (
    [in, optional, defaultvalue(0)] IInkStrokes* strokes,
    [in, optional, defaultvalue(IEF_Default)]
        InkExtractFlags extractFlags,
    [out, retval] IInkDisp **ExtractedInk
);

[Microsoft® Visual Basic® 6.0]

Public Function ExtractStrokes( _
  [strokes As InkStrokes], _
  [extractFlags As InkExtractFlags = IEF_RemoveFromOriginal] _
) As InkDisp

Parameters

strokes

[in, optional] Specifies the collection of strokes to extract. The default value specifies that all strokes are extracted.

Note: In Visual Basic 6.0, this parameter cannot be omitted if late binding is used. Instead, the default value of Nothing must be explicitly specified.

extractFlags

[in, optional] Specifies the InkExtractFlags enumeration type, which specifies whether the ink is cut or copied into the new InkDisp object. The default value cuts the strokes.

ExtractedInk

[out, retval] Returns a new InkDisp object that contains the extracted collection of cut or copied strokes.

Return Value

HRESULT value Description
S_OK Success.
E_POINTER A parameter contained an invalid pointer.
E_INK_MISMATCHED_INK_OBJECT The InkDisp object of the Strokes collection must match the known InkDisp object.
E_INK_EXCEPTION An exception occurred inside the method.
E_INK_SOME_STROKES_NOT_EXTRACTED Not all strokes were extracted.
E_OUTOFMEMORY Cannot allocate memory to complete the operation.
E_INVALIDARG Invalid extraction flags.
REGDB_CLASSNOTREG The InkDisp object class not registered.

Remarks

The new InkDisp object retains the drawing attributes, properties, and coordinates of the original InkDisp object.

This method is useful for creating a new InkDisp object without the deleted or cut strokes from the original object.

To extract strokes that are bound by a rectangle, call the ExtractStrokes(Rectangle) method.

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example demonstrates creating a new InkDisp object that contains the previously determined set of strokes, theDeletedStrokes, which are removed from the InkDisp object in the InkCollector, theInkCollector.

        Dim theNewInk As InkDisp
Set theNewInk = _
    theInkCollector..ExtractStrokes(theDeletedStrokes, _
    IEF_RemoveFromOriginal)
      

Applies To