【机器视觉】 dev_set_window_extents算子

00. 目录

01. 概述

dev_set_window_extents - 更改活动图形窗口的位置和大小。

02. 签名

dev_set_window_extents( : : Row, Column, Width, Height : )

03. 描述

dev_set_window_extents更改当前活动图形窗口的位置和/或大小。

参数Row和Column指定窗口的新位置(左上角)。 根据HDevelop的窗口模式,坐标(0,0)分别指的是在MDI模式的主HDevelop窗口中的窗口区域的左上角,以及在SDI模式下的屏幕的左上角。 该位置的负坐标被忽略,即在相应的方向上窗口不会被移动。

参数Width和Height指定窗口的新大小。 这是实际显示图形对象的内部部分的大小。 如果其中一个值是负数,那么相应的尺寸将保持不变。

原文描述

dev_set_window_extents changes the position and/or the size of the currently active graphics window.

The parameters Row and Column specify the new position (upper left corner) of the window. Depending on the window mode of HDevelop, the coordinates (0,0) refer to the upper left corner of the window area in the main HDevelop window in MDI mode, and the upper left corner of the screen in SDI mode, respectively. Negative coordinates of the position are ignored, i.e., in this direction the window will not be moved.

The parameters Width and Height specify the new size of the window. This is the size of the inner part that actually displays the iconic objects. If one of the two values is negative, this dimension will remain unchanged.

04. 注意

切勿使用set_window_extents更改HDevelop图形窗口的大小和位置。 必须使用算子dev_set_window_extents。

使用HDevelop的代码导出功能,为该算子生成的代码可能与相关的HALCON算子具有不同的行为。 有关将HDevelop图形算子导出为不同编程语言的代码的详细说明,请参阅“HDevelop User’s Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。

05. 参数

Row (input_control) rectangle.origin.y → (integer)
  Row index of upper left corner.
  Default value: 0
  Typical range of values: 0 ≤ Row
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Row >= 0) || (Row == -1)

Column (input_control) rectangle.origin.x → (integer)
  Column index of upper left corner.
  Default value: 0
  Typical range of values: 0 ≤ Column
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Column >= 0) || (Column == -1)

Width (input_control) rectangle.extent.x → (integer)
  Width of the window.
  Default value: 256
  Typical range of values: 0 ≤ Width
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Width > 0) || (Width == -1)

Height (input_control) rectangle.extent.y → (integer)
  Height of the window.
  Default value: 256
  Typical range of values: 0 ≤ Height
  Minimum increment: 1
  Recommended increment: 1
  Restriction: (Height > 0) || (Height == -1)

HDevelop例程

vector_to_proj_hom_mat2d.hdev Rectify image of stadium to simulate overhead view
gen_projective_mosaic.hdev Combine several images of a PCB into a large mosaic image
dev_set_window_extents.hdev Set size and position of a graphics window in HDevelop
dev_set_part.hdev Set the part of an image to be displayed (zoomed) in a graphics window in HDevelop
circular_barcode.hdev Read a circular bar code printed on a CD
cbm_caliper.hdev Measure the setting of a caliper using component-based matching in a perspectively distorted image
barcode_orientation.hdev Use the bar code parameter ‘orientation’

程序示例

dev_close_window ()
read_image (For5, 'for5')
get_image_size (For5, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (For5)
stop ()
dev_set_window_extents (-1,-1,Width/2,Height/2)
dev_display (For5)
stop ()
dev_set_window_extents (200,200,-1,-1)

06. 结果

如果指定参数的值正确,则dev_set_window_extents返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。

07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值