Operator Reference

draw_polygonT_draw_polygonDrawPolygonDrawPolygondraw_polygon (Operator)

draw_polygonT_draw_polygonDrawPolygonDrawPolygondraw_polygon — Interactive drawing of a polygon row.

Signature

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

Description

draw_polygondraw_polygonDrawPolygonDrawPolygondraw_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_colorSetColorSetColorset_color, set_rgbset_rgbSetRgbSetRgbset_rgb, etc. .

To put gray values on the created PolygonRegionPolygonRegionPolygonRegionpolygonRegionpolygon_region for further processing, you may use the operator reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain.

Attention

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.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

PolygonRegionPolygonRegionPolygonRegionpolygonRegionpolygon_region (output_object)  region objectHRegionHObjectHObjectHobject *

Region, which encompasses all painted points.

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

Window handle.

Example (HDevelop)

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

Example (C)

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

Example (HDevelop)

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

Example (HDevelop)

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

Result

If the window is valid, draw_polygondraw_polygonDrawPolygonDrawPolygondraw_polygon returns 2 ( H_MSG_TRUE) . If necessary, an exception is raised.

Possible Predecessors

open_windowopen_windowOpenWindowOpenWindowopen_window

Possible Successors

reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain, disp_regiondisp_regionDispRegionDispRegiondisp_region, set_coloredset_coloredSetColoredSetColoredset_colored, set_line_widthset_line_widthSetLineWidthSetLineWidthset_line_width, set_drawset_drawSetDrawSetDrawset_draw

Alternatives

draw_regiondraw_regionDrawRegionDrawRegiondraw_region, draw_circledraw_circleDrawCircleDrawCircledraw_circle, draw_rectangle1draw_rectangle1DrawRectangle1DrawRectangle1draw_rectangle1, draw_rectangle2draw_rectangle2DrawRectangle2DrawRectangle2draw_rectangle2, boundaryboundaryBoundaryBoundaryboundary

See also

reduce_domainreduce_domainReduceDomainReduceDomainreduce_domain, fill_upfill_upFillUpFillUpfill_up, set_colorset_colorSetColorSetColorset_color

Module

Foundation