本文整理汇总了C++中DRAW::line方法的典型用法代码示例。如果您正苦于以下问题:C++ DRAW::line方法的具体用法?C++ DRAW::line怎么用?C++ DRAW::line使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DRAW
的用法示例。
在下文中一共展示了DRAW::line方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
int
ImagingDrawRectangle(Imaging im, int x0, int y0, int x1, int y1,
const void* ink_, int fill, int op)
{
int y;
int tmp;
DRAW* draw;
INT32 ink;
DRAWINIT();
if (y0 > y1)
tmp = y0, y0 = y1, y1 = tmp;
if (fill) {
if (y0 < 0)
y0 = 0;
else if (y0 >= im->ysize)
return 0;
if (y1 < 0)
return 0;
else if (y1 > im->ysize)
y1 = im->ysize;
for (y = y0; y <= y1; y++)
draw->hline(im, x0, y, x1, ink);
} else {
/* outline */
draw->line(im, x0, y0, x1, y0, ink);
draw->line(im, x1, y0, x1, y1, ink);
draw->line(im, x1, y1, x0, y1, ink);
draw->line(im, x0, y1, x0, y0, ink);
}
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;
}
示例3: DRAWINIT
int
ImagingDrawLine(Imaging im, int x0, int y0, int x1, int y1, const void* ink_,
int op)
{
DRAW* draw;
INT32 ink;
DRAWINIT();
draw->line(im, x0, y0, x1, y1, ink);
return 0;
}