draw_polygonπ
Short descriptionπ
draw_polygon β Interactive drawing of a polygon row.
Signatureπ
draw_polygon( out region PolygonRegion, window WindowHandle )
Descriptionπ
draw_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_color,
set_rgb, etc.Β .
To put gray values on the created PolygonRegion for further processing,
you may use the operator reduce_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π
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π
PolygonRegion (output_object) region β object
Region, which encompasses all painted points.
WindowHandle (input_control) window β (handle)
Window handle.
Exampleπ
(HDevelop)
draw_polygon(&Polygon,WindowHandle)\;
shape_trans(Polygon,&Filled,"convex")\;
disp_region(Filled,WindowHandle)\;
Resultπ
If the window is valid, draw_polygon returns 2 (H_MSG_TRUE).
If necessary, an exception is raised.
Combinations with other operatorsπ
Combinations
Possible predecessors
Possible successors
reduce_domain, disp_region, set_colored, set_line_width, set_draw
Alternatives
draw_region, draw_circle, draw_rectangle1, draw_rectangle2, boundary
See also
Moduleπ
Foundation