|
StartInking
- 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
| Last news from Greatis Software |
 |
|
Nostalgia .Net |
|
.Net is powerful, but not all-powerful, so sometimes we need to use Win32 API for our .Net applications. It's simple enough with Platform Invoke if you have Win32 skill, but we do not always have time to dig the ancient documentation, declare the special types that are compatible with Win32, find the values of the Win32's constants and so on. Nostalgia .Net offers several simple-to-use classes, and components that will allow you to forget about the headache of Win32 and just use the power of Win32 in your application the same way as you use the native. Net classes. More » |
| Recommended software for developers |
 |
|
Ultimate Pack |
|
Component pack for Delphi and C++ Builder that contains runtime form designer, runtime object inspector, print suite and much more for the very special price. More » |
 |
|
Form Designer .Net |
|
Unique runtime form design solution that allows to edit any form in .Net WinForms application at runtime with full source codes for only 300 euro! More » |
 |
|
Print Suite .Net |
|
Print Suite .Net is a set of components for easy printing texts, images and grids from your WinForms applications. Full C# source codes are available More » |
 |
|
Gradient Controls .Net |
|
Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available More » |
 |
|
Greatis iGrid |
|
iGrid plots drawing grid right over your desktop, so you can use it everywhere, with any drawing application without any special plugins for different graphic editors. More » |
All the contacts and projectsDmitry Vasiliev (just.dmitry)
Related LinksSoftware for Visual Studio .NET developers Software for Delphi and C++ Builder developers Software for Visual Basic 6 developers Delphi Tips&Tricks MegaDetailed.NET More Online Helps Win32 Programmer's Reference Win32 Multimedia Programmer's Reference OLE Programmer's Reference Microsoft Windows Pen API Programmer's Reference Microsoft Windows Sockets 2 Reference Microsoft Windows Telephony API (TAPI) Programmer's Reference Unix Manual Pages
|