Skip to content

draw_regionDrawRegionDrawRegiondraw_regionT_draw_regionπŸ”—

Short descriptionπŸ”—

draw_regionDrawRegionDrawRegiondraw_regionT_draw_region β€” Interactive drawing of a closed region.

SignatureπŸ”—

draw_region( out region Region, window WindowHandle )void DrawRegion( HObject* Region, const HTuple& WindowHandle )static void HOperatorSet.DrawRegion( out HObject region, HTuple windowHandle )def draw_region( window_handle: HHandle ) -> HObject

Herror T_draw_region( Hobject* Region, const Htuple WindowHandle )

void HRegion::DrawRegion( const HWindow& WindowHandle )

HRegion HWindow::DrawRegion( ) const

void HRegion.DrawRegion( HWindow windowHandle )

HRegion HWindow.DrawRegion( )

DescriptionπŸ”—

draw_regionDrawRegion produces an image. The region of that image spans exactly the image region entered interactively by mouse clicks (gray values remain undefined). Painting happens in the output window while keeping the left mouse button pressed. The left mouse button even operates by clicking in the output window; through this a line between the previous clicked points is drawn. Clicking the right mouse button terminates input and closes the outline. Subsequently the image is β€œfilled up”. Also it contains the whole image area enclosed by the mouse.

Painting uses that color which has been set by set_colorSetColor, set_rgbSetRgb, etc.Β .

Pressing the right mouse button terminates the procedure.

AttentionπŸ”—

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

Regionregionregion (output_object) region β†’ objectHObjectHRegionHObjectHobject *

Interactive created region.

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

Window handle.

ExampleπŸ”—

(HDevelop)

read_image(Image,'fabrik')
dev_display (Image)
draw_region(Region,WindowHandle)
reduce_domain(Image,Region,ImageReduced)
invert_image (ImageReduced, ImageInvert)
dev_display (ImageInvert)
(C)
read_image(&Image,"fabrik")\;
disp_image(Image,WindowHandle)\;
draw_region(&Region,WindowHandle)\;
reduce_domain(Image,Region,&New)\;
regiongrowing(New,&Segmente,5,5,6,50)\;
set_colored(WindowHandle,12)\;
disp_region(Segmente,WindowHandle)\;

ResultπŸ”—

If the window is valid, draw_regionDrawRegion 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_circleDrawCircle, draw_ellipseDrawEllipse, draw_rectangle1DrawRectangle1, draw_rectangle2DrawRectangle2

See also

draw_polygonDrawPolygon, reduce_domainReduceDomain, fill_upFillUp, set_colorSetColor

ModuleπŸ”—

Foundation