draw_region — Interactive drawing of a closed region.
draw_region produces an image. The region of that image spans
exactly the image region entered interactively by mouse clicks (gray values
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_rgb, etc. .
Pressing the right mouse button terminates the procedure. On macOS
draw_region can also be terminated by pressing the escape key.
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.
Interactive created region.
read_image(Image,'fabrik') dev_display (Image) draw_region(Region,WindowHandle) reduce_domain(Image,Region,ImageReduced) invert_image (ImageReduced, ImageInvert) dev_display (ImageInvert)
If the window is valid,
draw_region returns 2 (H_MSG_TRUE).
If necessary, an exception is raised.