SAMPLE: RePaint.exe – Displaying Ink

ID: Q75846

The information in this article applies to:

SUMMARY

The DrawPenData() function, documented in the "Microsoft Windows for Pen Computing: Programmer's Reference" manual, does not exactly reproduce the appearance of the original "ink" generated by the system. However, the RedisplayPenData function does reproduce the appearance of the ink. The RePaint.exe is a sample application that demonstrates how to use RedisplayPenData.

MORE INFORMATION

The following file is available for download from the Microsoft Software Library:

 ~ RePaint.exe (size: 25099 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services

When the system displays ink on the screen, it uses an algorithm that is based on a square brush. The system considers the center of the square brush the "hot spot," around which it centers the ink. The DrawPenData() function then uses the Windows Polyline() API to draw the line on the screen. Polyline() assumes that its parameters specify the center points of what is to be drawn, and that the brush is round. The difference between the square and round brushes causes DrawPenData() to display diagonal lines narrower than the original ink. Note that a pen that is five pixels wide will be drawn approximately seven pixels wide by DrawPenData().

The new function, RedisplayPenData(), addresses this problem by redrawing the ink using a square brush such that the result is identical to original ink.

Additional query words: Keywords : kbfile kbsample kb16bitonly WpenInk

Last Reviewed: December 11, 1998