Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

Use the tabs on the upper right to switch to a different programming language.

dev_set_partdev_set_partDevSetPartDevSetPart (Operator)

Name

dev_set_partdev_set_partDevSetPartDevSetPart — Modify the displayed image part.

Signature

dev_set_part( : : Row1, Column1, Row2, Column2 : )

Herror dev_set_part(const Hlong Row1, const Hlong Column1, const Hlong Row2, const Hlong Column2)

Herror T_dev_set_part(const Htuple Row1, const Htuple Column1, const Htuple Row2, const Htuple Column2)

void DevSetPart(const HTuple& Row1, const HTuple& Column1, const HTuple& Row2, const HTuple& Column2)

static void HWindow::DevSetPart(Hlong Row1, Hlong Column1, Hlong Row2, Hlong Column2)

static void HOperatorSet.DevSetPart(HTuple row1, HTuple column1, HTuple row2, HTuple column2)

static void HWindow.DevSetPart(int row1, int column1, int row2, int column2)

Description

dev_set_partdev_set_partDevSetPartDevSetPartDevSetPart is used to set the part of the image that is displayed in the graphics window. The parameters Row1Row1Row1Row1row1 and Column1Column1Column1Column1column1 specify the upper left corner, Row2Row2Row2Row2row2 and Column2Column2Column2Column2column2 the lower right corner of the image part to display.

For more information see the description of the operator set_partset_partSetPartSetPartSetPart. In addition, if Row1Row1Row1Row1row1 is larger than Row2Row2Row2Row2row2 or Column1Column1Column1Column1column1 larger than Column2Column2Column2Column2column2, the zooming in the particular dimension will be reset to show the complete height and/or width of the image. Please note that this is not possible with the operator set_partset_partSetPartSetPartSetPart outside HDevelop.

In addition, note that the part is automatically reset, if a new program is loaded, a program reset is performed, or a new image with a different image size is displayed.

Attention

Using the code export feature of HDevelop, the code that is generated for this operator may have a different behavior than the related HALCON operator. For a detailed description of the code export of HDevelop graphics operators into the different programming languages see in the “HDevelop User's Guide” the chapter Code Export -> General Aspects of Code Generation -> Graphics Windows.

Parameters

Row1Row1Row1Row1row1 (input_control)  rectangle.origin.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row of the upper left corner of the chosen image part.

Default value: 0

Column1Column1Column1Column1column1 (input_control)  rectangle.origin.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column of the upper left corner of the chosen image part.

Default value: 0

Row2Row2Row2Row2row2 (input_control)  rectangle.corner.y HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row of the lower right corner of the chosen image part.

Default value: 128

Column2Column2Column2Column2column2 (input_control)  rectangle.corner.x HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column of the lower right corner of the chosen image part.

Default value: 128

Example (HDevelop)

read_image (Image, 'fabrik')
for i := 1 to 240 by 10
  dev_set_part (i, i, 511-i, 511-i)
  dev_display (Image)
endfor
dev_set_part (1, 1, -1, -1)
dev_display (Image)

Result

If the values of the specified parameters are correct, dev_set_partdev_set_partDevSetPartDevSetPartDevSetPart returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Possible Successors

dev_displaydev_displayDevDisplayDevDisplayDevDisplay

See also

set_partset_partSetPartSetPartSetPart

Module

Foundation