How to Get Windows NT PolyDraw() Functionality in Windows 95Last reviewed: September 29, 1995Article ID: Q135059 |
The information in this article applies to:
SUMMARYThis article shows by example how to get the functionality provided by the Win32 function PolyDraw() in Windows 95.
MORE INFORMATIONThe Windows NT PolyDraw() function draws a set of line segments and Bezier curves. PolyDraw() can be used in place of consecutive calls to the MoveToEx(), LineTo(), and PolyBezierTo() functions to draw disjoint figures. The lines and curves are drawn using the current pen, and figures are not filled. If there is an active path started by calling BeginPath(), then PolyDraw() adds to the path. The points contained in the lppt array and in the lpbTypes array indicate whether each point is part of a MoveToEx(), LineTo(), or PolyBezierTo() operation. It is also possible to close figures.
Code SampleThe following function enables you to get the functionality of the Windows NT PolyDraw() function in Windows 95:
/********************************************************************** * * * FUNCTION: PolyDraw95(HDC, LPPOINT, LPBYTE, int) * * * * PURPOSE: Draws the points returned from a call to GetPath() * * to an HDC * * * * NOTES: This function is similar to the Windows NT PolyDraw * * function, which draws a set of line segments and Bezier * * curves. Because PolyDraw is not supported in Windows 95 * * this PolyDraw95 function is used instead. * * * *********************************************************************/ BOOL PolyDraw95(HDC hdc, // handle of a device context CONST LPPOINT lppt, // array of points CONST LPBYTE lpbTypes, // line and curve identifiers int cCount) // count of points { int i; for (i=0; i<cCount; i++) switch (lpbTypes[i]) { case PT_MOVETO : MoveToEx(hdc, lppt[i].x, lppt[i].y, NULL); break; case PT_LINETO | PT_CLOSEFIGURE: case PT_LINETO : LineTo(hdc, lppt[i].x, lppt[i].y); break; case PT_BEZIERTO | PT_CLOSEFIGURE: case PT_BEZIERTO : PolyBezierTo(hdc, &lppt[i], 3); i+=2; break; } return TRUE;}
|
Additional reference words: 95 4.00 PolyDraw Draw Poly Stones Win95 GDI
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |