本文整理汇总了C++中DRAW::polygon方法的典型用法代码示例。如果您正苦于以下问题:C++ DRAW::polygon方法的具体用法?C++ DRAW::polygon怎么用?C++ DRAW::polygon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DRAW
的用法示例。
在下文中一共展示了DRAW::polygon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DRAWINIT
int
ImagingDrawOutline(Imaging im, ImagingOutline outline, const void* ink_,
int fill, int op)
{
DRAW* draw;
INT32 ink;
DRAWINIT();
draw->polygon(im, outline->count, outline->edges, ink, 0);
return 0;
}
示例2: DRAWINIT
int
ImagingDrawPolygon(Imaging im, int count, int* xy, const void* ink_,
int fill, int op)
{
int i, n;
DRAW* draw;
INT32 ink;
if (count <= 0)
return 0;
DRAWINIT();
if (fill) {
/* Build edge list */
/* malloc check ok, using calloc */
Edge* e = calloc(count, sizeof(Edge));
if (!e) {
(void) ImagingError_MemoryError();
return -1;
}
for (i = n = 0; i < count-1; i++)
add_edge(&e[n++], xy[i+i], xy[i+i+1], xy[i+i+2], xy[i+i+3]);
if (xy[i+i] != xy[0] || xy[i+i+1] != xy[1])
add_edge(&e[n++], xy[i+i], xy[i+i+1], xy[0], xy[1]);
draw->polygon(im, n, e, ink, 0);
free(e);
} else {
/* Outline */
for (i = 0; i < count-1; i++)
draw->line(im, xy[i+i], xy[i+i+1], xy[i+i+2], xy[i+i+3], ink);
draw->line(im, xy[i+i], xy[i+i+1], xy[0], xy[1], ink);
}
return 0;
}