StartInking

  1. 0

Starts inking feedback while pen input is being collected.

int StartInking( HPCM hpcm, UINT idEvent, LPINKINGINFO lpinkinginfo )

Parameters

hpcm

Handle to the current collection. This is the return value from StartPenInput.

idEvent

The identifier of the packet at which to start inking.

lpinkinginfo

Address of an INKINGINFO structure, used to specify the characteristics of the ink. This parameter can be NULL to use the default ink characteristics. Otherwise, the structure's cbSize member must be initialized with sizeof( INKINGINFO ).

Return Value

Returns PCMR_OK if inking started successfully; otherwise, returns one of the following:

Constant
Description
PCMR_DISPLAYERR
There is no display device, or it was unable to ink at this time, or there was an error in setting the pen-tip characteristics.
PCMR_ERROR
The INKINGINFO structure contains invalid values, or there was some other unspecified error.
PCMR_INVALIDCOLLECTION
The hpcm handle is invalid because the calling application did not start input by calling StartPenInput.
PCMR_INVALID_PACKETID
The idEvent parameter is invalid.

Comments

An application calls StartInking to track pen movement while the pen tip is down. When pen input is started by calling the StartPenInput function, Windows initializes the internal INKINGINFO structure as follows:

  • The wFlags member is set to PII_INKPENTIP | PII_INKCLIPRECT.

  • The tip member is set to the system default pen tip, as obtained by calling the GetPenMiscInfo function.

  • The rectClip member is set to the client area, in screen coordinates, of the window that was used in the call to the StartPenInput function.

The first call to StartInking with the lpinkinginfo parameter set to NULL starts inking with the settings listed above. If the calling application uses a non-NULL value for lpinkinginfo, the appropriate internal inking parameters are modified before inking starts, depending on the flags set in the wFlags member of the INKINGINFO structure.

Whenever StartInking is called, the current settings of the internal inking structure are added to or replaced. Specific values must be set in the members of INKINGINFO to disable them. Refer to the description of each member in the INKINGINFO structure for these values.

If a region is passed in for clipping or stopping the ink, the application must destroy the region. Since a copy is made, the region can be destroyed immediately following the call to StartInking. The application can specify either a clip region or a clip rectangle. Specifying both will result in the clip rectangle being ignored.

Example

The following code example changes the inking tip from the default (as set by a call to StartPenInput) to red ink, 5 pixels wide. It also adds an inkstop rectangle (inking stops if the pen touches down inside the inkstop rectangle). The clipping rectangle remains unchanged from the default settings.

INKINGINFO inkinginfo;

inkinginfo.cbSize = sizeof( INKINGINFO );

inkinginfo.wFlags = PII_INKPENTIP | PII_INKSTOPRECT;

inkinginfo.tip.cbSize = sizeof( PENTIP );

inkinginfo.tip.rgb = RGB( 255,0,0 );

inkinginfo.tip.bwidth = 5;

inkinginfo.rectInkStop.left = rectInkTop.top = 0;

inkinginfo.rectInkStop.right = rectInkTop.bottom = 100;

ClientToScreen( hwnd, (LPPOINT)&(inkinginfo.rectInkStop) );

ClientToScreen( hwnd, (LPPOINT)&(inkinginfo.rectInkStop.right) );

StartInking( hpcm, wEventRef, &inkinginfo );

See Also

INKINGINFO
, StartPenInput, StopInking

Software for developers
Delphi Components
.Net Components
Software for Android Developers
More information resources
MegaDetailed.Net
Unix Manual Pages
Delphi Examples
Databases for Amazon shops developers
Amazon Categories Database
Browse Nodes Database