draw_polygonT_draw_polygonDrawPolygonDrawPolygondraw_polygon (算子名称)

名称

draw_polygonT_draw_polygonDrawPolygonDrawPolygondraw_polygon — Interactive drawing of a polygon row.

参数签名

draw_polygon( : PolygonRegion : WindowHandle : )

Herror T_draw_polygon(Hobject* PolygonRegion, const Htuple WindowHandle)

void DrawPolygon(HObject* PolygonRegion, const HTuple& WindowHandle)

void HRegion::DrawPolygon(const HWindow& WindowHandle)

HRegion HWindow::DrawPolygon() const

static void HOperatorSet.DrawPolygon(out HObject polygonRegion, HTuple windowHandle)

void HRegion.DrawPolygon(HWindow windowHandle)

HRegion HWindow.DrawPolygon()

def draw_polygon(window_handle: HHandle) -> HObject

描述

draw_polygondraw_polygonDrawPolygonDrawPolygonDrawPolygondraw_polygon produces an image. The region of that image spans exactly the image points entered interactively by mouse clicks (gray values remain undefined).

Painting in the output window happens while pressing the left mouse button. Releasing the left mouse button and repressing it at another position effects drawing a line between these two points. Pressing the right mouse button terminates the input. Painting uses that color which has been set by set_colorset_colorSetColorSetColorSetColorset_color, set_rgbset_rgbSetRgbSetRgbSetRgbset_rgb, etc. .

To put gray values on the created PolygonRegionPolygonRegionPolygonRegionPolygonRegionpolygonRegionpolygon_region for further processing, you may use 该算子 reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain.

注意

The painted contour is not closed automatically, in particular it is not “filled up” either.

Output object's gray values are not defined.

If used in a buffer window, mouse events have to be supplied by the application, while the draw operator must be run in another thread.

运行信息

参数表

PolygonRegionPolygonRegionPolygonRegionPolygonRegionpolygonRegionpolygon_region (output_object)  region objectHRegionHObjectHRegionHobject *

Region, which encompasses all painted points.

WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control)  window HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)

Window handle.

例程 (HDevelop)

draw_polygon(Polygon,WindowHandle)
shape_trans(Polygon,Filled,'convex')
dev_display (Filled)

例程 (C)

draw_polygon(&Polygon,WindowHandle);
shape_trans(Polygon,&Filled,"convex");
disp_region(Filled,WindowHandle);

例程 (HDevelop)

draw_polygon(Polygon,WindowHandle)
shape_trans(Polygon,Filled,'convex')
dev_display (Filled)

例程 (HDevelop)

draw_polygon(Polygon,WindowHandle)
shape_trans(Polygon,Filled,'convex')
dev_display (Filled)

例程 (HDevelop)

draw_polygon(Polygon,WindowHandle)
shape_trans(Polygon,Filled,'convex')
dev_display (Filled)

结果

If the window is valid, draw_polygondraw_polygonDrawPolygonDrawPolygonDrawPolygondraw_polygon returns 2 ( H_MSG_TRUE) . 如有必要,将引发异常。

可能的前置算子

open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window

可能的后置算子

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, disp_regiondisp_regionDispRegionDispRegionDispRegiondisp_region, set_coloredset_coloredSetColoredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width, set_drawset_drawSetDrawSetDrawSetDrawset_draw

可替代算子

draw_regiondraw_regionDrawRegionDrawRegionDrawRegiondraw_region, draw_circledraw_circleDrawCircleDrawCircleDrawCircledraw_circle, draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1DrawRectangle1draw_rectangle1, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2DrawRectangle2draw_rectangle2, boundaryboundaryBoundaryBoundaryBoundaryboundary

参考其它

reduce_domainreduce_domainReduceDomainReduceDomainReduceDomainreduce_domain, fill_upfill_upFillUpFillUpFillUpfill_up, set_colorset_colorSetColorSetColorSetColorset_color

模块

Foundation