Q65200: _polygon() with _GFILLINTERIOR Does Not Work When Clipped
Article: Q65200
Product(s): See article
Version(s): 6.00
Operating System(s): MS-DOS
Keyword(s): ENDUSER | buglist6.00 s_quickc setcliprgn | mspl13_c
Last Modified: 17-DEC-1990
When _polygon is called to draw a filled polygon inside a clip region
set with _setcliprgn, the polygon may not be drawn correctly. The
following program demonstrates the error:
#include <graph.h>
struct xycoord pts[4] = {{0,0}, {55,55}, {83,25}, {0,0}};
void main(void)
{
_setvideomode(_ERESCOLOR);
/* show the polygon */
_setcolor(3);
_polygon(_GFILLINTERIOR, pts, 4);
getch();
/* show the clipped region */
_setcolor(3);
_rectangle(_GBORDER, 0, 0, 75, 50);
_setcliprgn(0,0, 75, 50);
getch();
/*** polygon drawn will have portion missing with _GFILLINTERIOR ***/
_setcolor(10);
_polygon(_GFILLINTERIOR, pts, 4);
getch();
/* clipped polygon drawn correctly with _GBORDER */
_setcolor(12);
_polygon(_GBORDER, pts, 4);
getch();
_setvideomode(_DEFAULTMODE);
}
Any horizontal lines that are being clipped will not be drawn at all.
Microsoft has confirmed this to be a problem with C version 6.00. We
are researching this problem and will post new information here when
it becomes available.
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.
Copyright Microsoft Corporation 1986-2002.