fillpolygon.c
来自「Nxlib,一个模拟xlib的程序。使用microwindows的库来运行需要x」· C语言 代码 · 共 38 行
C
38 行
#include <stdio.h>#include <stdlib.h>#include "nxlib.h"intXFillPolygon(Display * display, Drawable d, GC gc, XPoint * points, int npoints, int shape, int mode){ int i; GR_POINT *gr_points; gr_points = ALLOCA(npoints * sizeof(GR_POINT)); if (mode == CoordModeOrigin) { for (i = 0; i < npoints; i++) { gr_points[i].x = points[i].x; gr_points[i].y = points[i].y; } } else { /* CoordModePrevious */ int px = 0, py = 0; for (i = 0; i < npoints; i++) { gr_points[i].x = px + points[i].x; gr_points[i].y = py + points[i].y; px += points[i].x; py += points[i].y; } } if (shape == Complex || shape == Convex) printf("XFillPolygon: Complex/Convex\n"); GrFillPoly(d, gc->gid, npoints, gr_points); FREEA(gr_points); return 1;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?