SAMPLE: Using DrawPenData() or RedisplayPenData() to Display Ink

Last reviewed: February 15, 1996
Article ID: Q75846
The information in this article applies to:
  • Microsoft Windows for Pen Computing version 1.0

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 sample application in the Microsoft Software Library demonstrates using RedisplayPenData.

Download REPAINT.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download REPAINT.EXE (size: 25099 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get REPAINT.EXE (size: 25099 bytes) 
    

MORE INFORMATION

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 reference words: 1.00 softlib REPAINT.EXE
KBCategory: kbprg kbfile
KBSubcategory: WpenInk


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.