Skip to content

draw_polygonDrawPolygonDrawPolygondraw_polygonT_draw_polygonπŸ”—

Short descriptionπŸ”—

draw_polygonDrawPolygonDrawPolygondraw_polygonT_draw_polygon β€” Interactive drawing of a polygon row.

SignatureπŸ”—

draw_polygon( out region PolygonRegion, window WindowHandle )void DrawPolygon( HObject* PolygonRegion, const HTuple& WindowHandle )static void HOperatorSet.DrawPolygon( out HObject polygonRegion, HTuple windowHandle )def draw_polygon( window_handle: HHandle ) -> HObject

Herror T_draw_polygon( Hobject* PolygonRegion, const Htuple WindowHandle )

void HRegion::DrawPolygon( const HWindow& WindowHandle )

HRegion HWindow::DrawPolygon( ) const

void HRegion.DrawPolygon( HWindow windowHandle )

HRegion HWindow.DrawPolygon( )

DescriptionπŸ”—

draw_polygonDrawPolygon 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_colorSetColor, set_rgbSetRgb, etc.Β .

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

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πŸ”—

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πŸ”—

PolygonRegionpolygonRegionpolygon_region (output_object) region β†’ objectHObjectHRegionHObjectHobject *

Region, which encompasses all painted points.

WindowHandlewindowHandlewindow_handle (input_control) window β†’ (handle)HTuple (HHandle)HWindow, HTuple (IntPtr)HHandleHtuple (handle)

Window handle.

ExampleπŸ”—

(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)\;

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

open_windowOpenWindow

Possible successors

reduce_domainReduceDomain, disp_regionDispRegion, set_coloredSetColored, set_line_widthSetLineWidth, set_drawSetDraw

Alternatives

draw_regionDrawRegion, draw_circleDrawCircle, draw_rectangle1DrawRectangle1, draw_rectangle2DrawRectangle2, boundaryBoundary

See also

reduce_domainReduceDomain, fill_upFillUp, set_colorSetColor

ModuleπŸ”—

Foundation