The information in this article applies to:
SUMMARYThe Microsoft Windows graphical environment provides six predefined pens for drawing dotted, dashed, and solid lines. However, an application cannot draw fine gray lines, such as those on a Microsoft Excel spreadsheet, with these pens. This article describes how to create such lines. MORE INFORMATION
An application can use the LineDDA function to produce any type of
patterned line. Based on the endpoints of a line, LineDDA calculates
each point on the line and calls an application-defined callback
function for each point. The callback function is free to use the
calculated points in any manner desired. An application can draw a
gray line similar to those used in Excel by calling the the SetPixel
function in the callback function to draw every other point.
For more information on this function, see pages 4-272 and 4-273 of
the "Microsoft Windows Software Development Kit Reference, Volume 1"
for Windows 3.0 or pages 568 and 569 of the "Microsoft Windows
Software Development Kit: Programmer's Reference, Volume 2: Functions"
for Windows 3.1. Charles Petzold's book "Programming Windows 3"
(Microsoft Press, 1990) demonstrates using the LineDDA function in a
programming example on pages 593 through 598.
The following code fragment draws 50 random Excel-style lines. Note that the LineProc function must be listed as an EXPORT in the module definition (DEF) file:
Additional query words: 3.00 3.10 3.50 4.00 win16sdk
Keywords : kbNTOS350 kbNTOS351 kbNTOS400 kbWinOS95 kbSDKWin16 |
Last Reviewed: June 16, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |