Home   Index   About
Ultimate Pack


Custom Search
GetStrokeAttributes

2.0

Retrieves information about a stroke in an HPENDATA object.

int GetStrokeAttributes( HPENDATA hpndt, UINT iStrk, LPVOID lpvBuffer, UINT uOption )

Parameters

hpndt

Handle to the HPENDATA object, which must not be compressed.

iStrk

Zero-based stroke index. If there are no strokes in the pen data, an index of 0 can be used to retrieve the default attributes for the pen data. A value of IX_END specifies the last available stroke in the pen data.

lpvBuffer

Pointer to a structure whose type depends on uOption, or NULL if the uOption parameter does not require this buffer.

uOption

Specifies the attributes to retrieve. This parameter has one of the following values:

Constant
Description
GSA_DOWN
Retrieve the up/down state of the pen tip for this stroke. Returns 1 if the stroke is a down-stroke or 0 if it is an up-stroke. lpvBuffer is unused and ignored.
GSA_PENTIP
Retrieve the pen-tip characteristics (color, width, nib) used by the stroke specified by iStrk. lpvBuffer is a pointer to a PENTIP structure. Return value is PDR_OK.
GSA_PENTIPCLASS
Retrieve the pen-tip characteristics (color, width, nib), if any, for the class of strokes of which the stroke specified by iStrk is a member. lpvBuffer is a pointer to a PENTIP structure. Return value is PDR_OK.
GSA_RECTBOUND
Retrieve the bounding rectangle of the specified stroke. lpvBuffer is a pointer to a RECT structure. Return value is PDR_OK.
GSA_SELECT
Retrieve the selection status of the specified stroke. lpvBuffer is unused and ignored. Returns a nonzero value if the stroke is selected; otherwise, the return value is 0.
GSA_SIZE
Retrieve size of stroke in points and bytes. lpvBuffer is a pointer to a double-word value, or NULL. LOWORD(*(LPDWORD)lpvBuffer) is the size in points, and HIWORD(*(LPDWORD)lpvBuffer) is the size in bytes. Return value is PDR_OK.
GSA_TIME
Retrieve the absolute time of the stroke. lpvBuffer is a pointer to an ABSTIME structure; it cannot be NULL. The sec field specifies the number of seconds since Jan 1, 1970, and the ms field specifies the number of milliseconds offset from that time to the beginning of the stroke. Return value is PDR_OK.
GSA_USER
Retrieve the user value, if any, for the stroke. lpvBuffer is a pointer to a double-word value, or NULL. Returns the number of bytes of user data available in the stroke: 0, 1, 2, or 4.
GSA_USERCLASS
Retrieve the user value, if any, for the class of strokes of which the stroke specified by iStrk is a member. lpvBuffer is a pointer to a double-word value, or NULL. The return value is 4 because the user value in the strokes class table is a doubleword value.

Return Value

Returns PDR_OK or an integer value if successful, as described for the uOption parameter. If an error occurs, returns one of the following:

Constant
Description
PDR_COMPRESSED
Pen data is compressed.
PDR_ERROR
Parameter or other unspecified error.
PDR_MEMERR
Memory error.
PDR_PNDTERR
Invalid pen data.
PDR_STRKINDEXERR
Invalid stroke index.
PDR_TIMESTAMPERR
Timing information was removed.
PDR_VERSIONERR
Could not convert old pen data.

See Also

CreatePenDataEx
, GetStrokeTableAttributes, SetStrokeAttributes, SetStrokeTableAttributes, PENTIP


Last news from Greatis Software

Nostalgia .Net     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 for Delphi and C++ Builder     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     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     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     Gradient Controls .Net offers controls with gradient background feature. Labels, panels and so on... Full C# source codes are available  More »

iGrid     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 projects

Dmitry Vasiliev (just.dmitry)

Related Links

Software 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

Free Tech Secrets ;) Copyright © 2008-2012 Free Tech Secrets ;) greatis just4fun network just4fun