RawWndProc

The RawWndProc function is a standard Windows procedure for the Raw Data child window. It calls the DrawRawData function to draw a copy of the input resized for the Raw Data window. Normal pen-down strokes appear in the current window color; pen-up strokes appear in blue. Note that the system recognizer GRECO.DLL does not collect pen-up strokes. Therefore, the blue pen-up strokes do not appear when default recognition is selected from the menu.

DrawRawData calls the DrawPenDataEx function to display the strokes. Since DrawPenDataEx does not show pen-up strokes, DrawRawData first changes all pen-up strokes to pen-down strokes. The following fragment illustrates this:

VOID DrawRawData( HDC hdc )

{

PENDATAHEADER pendataheader; // Header for vhpendata

HPEN hpenUp, hpenSave; // GDI pen for up-strokes

UINT fPen; // Pen flag

UINT iStroke=0; // Stroke counter

int nWidth; // Ink width

.

.

.

if ( !GetPenDataInfo( vhpendata, &pendataheader, NULL, 0 ))

return;

nWidth = NSetExtents (hdc, &pendataheader, &rectWnd );

hpenUp = CreatePen( PS_SOLID, nWidth, rgbBlue );

hpenSave = SelectObject( hdc, hpenUp );

// Loop for each stroke, beginning with first

for (iStroke = 0; iStroke < pendataheader.cStrokes; ++iStroke)

{

//

// If down stroke, use same ink characteristics as original.

// If up stroke, first call SetStrokeAttributes to convert it

// to a down stroke, then draw it in blue ink with GDI pen.

//

if (GetStrokeAttributes(vhpendata, iStroke, NULL, GSA_DOWN))

fPen = DPD_DRAWSEL;

else

{

SetStrokeAttributes( vhpendata, iStroke, 1, SSA_DOWN );

fPen = DPD_HDCPEN;

}

iRet = DrawPenDataEx(hdc, NULL, vhpendata, iStroke, iStroke,

0, IX_END, NULL, NULL, fPen );

// Set altered strokes back to their original pen-up state

if (fPen == DPD_HDCPEN)

SetStrokeAttributes( vhpendata, iStroke, 0, SSA_DOWN );

}

SelectObject( hdc, hpenSave );

DeleteObject( hpenUp );

return

}

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