IInkDisp::ExtractWithRectangle method (msinkaut.h)

Cuts or copies strokes from an existing InkDisp object and pastes them into a new InkDisp object, by using the known rectangle to determine which strokes to extract.

Syntax

HRESULT ExtractWithRectangle(
  [in]           IInkRectangle   *Rectangle,
  [in, optional] InkExtractFlags extractFlags,
  [out, retval]  IInkDisp        **ExtractedInk
);

Parameters

[in] Rectangle

Specifies the InkRectangle object which delimits the ink to extract from the InkDisp object.

[in, optional] extractFlags

Optional. Specifies the InkExtractFlags enumeration type, which determines whether the ink should be cut or copied from the existing InkDisp object. The default value is IEF_DEFAULT, which cuts the strokes from the existing InkDisp object.

[out, retval] ExtractedInk

When this method returns, contains a pointer to an InkDisp object that contains the extracted collection of strokes.

Return value

This method can return one of these values.

Return code Description
S_OK
Success.
E_POINTER
A parameter contained an invalid pointer.
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 Ink object was 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 from a known collection of strokes, call the ExtractStrokes Method.

Only the portion of a stroke that is within the rectangle is added to the new InkDisp object.

When the extractFlags parameter is RemoveFromOriginal or Default, any strokes that cross the rectangle are split and the portion within the rectangle removed from the existing InkDisp object.

Requirements

Requirement Value
Minimum supported client Windows XP Tablet PC Edition [desktop apps only]
Minimum supported server None supported
Target Platform Windows
Header msinkaut.h
Library InkObj.dll

See also

ExtractStrokes Method

IInkDisp

InkDisp Class

InkExtractFlags Enumeration

InkRectangle Class

InkStrokes Collection