名称
dev_set_part - 修改要显示的图像部分。
用法
dev_set_part( : : Row1, Column1, Row2, Column2 : )
描述
dev_set_part用于设置图形窗口中要显示的图像部分。 参数Row1和Column1指定左上角,Row2和Column2指定要显示的图像部分的右下角。
有关更多信息,请参阅算子set_part的说明。 另外,如果Row1比Row2大或Column1比Column2大,那么特定尺寸缩放将被重置,以显示图像的完整高度(和/或)宽度。 请注意,对于在HDevelop环境以外的此算子和算子set_part,此功能无效。
另外,请注意,如果加载新程序,程序复位或显示图像尺寸大小不同的新图像,则会自动复位显示部分。
注意
使用HDevelop的代码导出功能,为该算子生成的代码可能与相关的HALCON算子具有不同的行为。 有关将HDevelop图形算子导出为不同编程语言的代码的详细说明,请参阅“HDevelop User's Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。
参数
Row1 (input_control) rectangle.origin.y → (integer)
Row of the upper left corner of the chosen image part.
Default value: 0
Column1 (input_control) rectangle.origin.x → (integer)
Column of the upper left corner of the chosen image part.
Default value: 0
Row2 (input_control) rectangle.corner.y → (integer)
Row of the lower right corner of the chosen image part.
Default value: 128
Column2 (input_control) rectangle.corner.x → (integer)
Column of the lower right corner of the chosen image part.
Default value: 128
示例(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)
结果
如果指定参数的值正确,则dev_set_part返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。
Possible Successors
dev_display
See also
set_part
模块
Foundation
HDevelop例程
roads.hdev Extract roads from aerial image
rim.hdev Inspect holes and characters on a rim
pm_measure_board.hdev Locate IC on a board and measure pin distances
measure_screw.hdev Measure several features of a screw
fit_ellipse_tooth_rim_xld.hdev Approximate the contour of a tooth rim with an ellipse to find its center
fill_interlace.hdev Interpolate video half images
edges_color_sub_pix.hdev Extract edges with sub-pixel precision using color information
edges_color.hdev Extract edges using color information
display_operators.hdev Visualize results
dev_set_part.hdev Set the part of an image to be displayed (zoomed) in a graphics window in HDevelop
dev_open_window.hdev Open graphics windows in HDevelop
critical_points_sub_pix.hdev Detect critical points with subpixel accuracy
clip_contours_xld.hdev Clip an XLD contour