Skip to content

create_drawing_object_rectangle1CreateDrawingObjectRectangle1CreateDrawingObjectRectangle1create_drawing_object_rectangle1T_create_drawing_object_rectangle1🔗

Short description🔗

create_drawing_object_rectangle1CreateDrawingObjectRectangle1CreateDrawingObjectRectangle1create_drawing_object_rectangle1T_create_drawing_object_rectangle1 — Create a rectangle parallel to the coordinate axis which can be modified interactively.

Signature🔗

create_drawing_object_rectangle1( rectangle.origin.y Row1, rectangle.origin.x Column1, rectangle.corner.y Row2, rectangle.corner.x Column2, out drawing_object DrawID )void CreateDrawingObjectRectangle1( const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2, HTuple* DrawID )static void HOperatorSet.CreateDrawingObjectRectangle1( HTuple row1, HTuple column1, HTuple row2, HTuple column2, out HTuple drawID )def create_drawing_object_rectangle1( row_1: float, column_1: float, row_2: float, column_2: float ) -> HHandle

Herror T_create_drawing_object_rectangle1( const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2, Htuple* DrawID )

void HDrawingObject::HDrawingObject( double Row1, double Column1, double Row2, double Column2 )

public HDrawingObject( double row1, double column1, double row2, double column2 )

void HDrawingObject::CreateDrawingObjectRectangle1( double Row1, double Column1, double Row2, double Column2 )

void HDrawingObject.CreateDrawingObjectRectangle1( double row1, double column1, double row2, double column2 )

Description🔗

create_drawing_object_rectangle1CreateDrawingObjectRectangle1 creates a rectangle aligned along the coordinate axis which can be modified interactively in a HALCON window by the user. The rectangle is defined by the coordinates Row1row1row_1, Column1column1column_1, Row2row2row_2, and Column2column2column_2 of its upper left and lower right corner. The created rectangle is returned in the handle DrawIDdrawIDdraw_id.

These parameters can be queried any time with get_drawing_object_paramsGetDrawingObjectParams, as well as its corresponding HALCON object with get_drawing_object_iconicGetDrawingObjectIconic.

In addition to those parameters, every drawing object has a number of parameters which determine the appearance of the object in the HALCON window. See set_drawing_object_paramsSetDrawingObjectParams for details on the number and meaning of those parameters.

In order to enable the interactive modification with the drawing object, the object must be attached to an existing window. See attach_drawing_object_to_windowAttachDrawingObjectToWindow for further details. Once attached, the rectangle is editable by the user through interaction with the window. There are two possible transformations for a rectangle1 object: resizing and displacement. The rectangle can be moved by dragging in the middle of the rectangle and resized by dragging the handles of the corners.

In contrast to the operator draw_rectangle1DrawRectangle1, this interaction does not block the calling 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.

This operator returns a handle. Note that the state of an instance of this handle type may be changed by specific operators even though the handle is used as an input parameter by those operators.

Parameters🔗

Row1row1row_1 (input_control) rectangle.origin.y → (real)HTuple (double)HTuple (double)floatHtuple (double)

Row coordinate of the upper left corner.

Default: 100100

Column1column1column_1 (input_control) rectangle.origin.x → (real)HTuple (double)HTuple (double)floatHtuple (double)

Column coordinate of the upper left corner.

Default: 100100

Row2row2row_2 (input_control) rectangle.corner.y → (real)HTuple (double)HTuple (double)floatHtuple (double)

Row coordinate of the lower right corner.

Default: 200200

Column2column2column_2 (input_control) rectangle.corner.x → (real)HTuple (double)HTuple (double)floatHtuple (double)

Column coordinate of the lower right corner.

Default: 200200

DrawIDdrawIDdraw_id (output_control) drawing_object → (handle)HTuple (HHandle)HDrawingObject, HTuple (IntPtr)HHandleHtuple (handle)

Handle of the drawing object.

Result🔗

If the parameter values are correct, the operator create_drawing_object_rectangle1CreateDrawingObjectRectangle1 returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

open_windowOpenWindow

Possible successors

disp_regionDispRegion, set_coloredSetColored, set_line_widthSetLineWidth, set_drawSetDraw, attach_drawing_object_to_windowAttachDrawingObjectToWindow

Alternatives

draw_rectangle1_modDrawRectangle1Mod, draw_rectangle2DrawRectangle2, draw_regionDrawRegion

See also

gen_rectangle1GenRectangle1, draw_circleDrawCircle, draw_ellipseDrawEllipse

Module🔗

Foundation