工控编程吧

标题: halcon图形mouse函数详细介绍 [打印本页]

作者: qq263946146    时间: 2019-11-6 12:40
标题: halcon图形mouse函数详细介绍
Halcon还提供针对鼠标的相关函数,主要也是用于人机交互,
获取用户鼠标操作相关自息或让用户向halcon发送鼠标相关信息。
我们可以在halcon运行这些函数,查看功能。
这些函数有
get_mbutton
get_mbutton_sub_pix
get_mposition
get_mposition_sub_pix
get_mshape
query_mshape
send_mouse_double_click_event
send_mouse_down_event
send_mouse_drag_event
send_mouse_up_event
set_mshape

实例
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
get_mbutton (WindowHandle, Row, Column, Button)
get_mbutton_sub_pix (WindowHandle, Row, Column, Button)
tuple_band (Button, 0x01,rst)
tuple_band (Button, 0x016,rst2)
if(rst == 0x01)
    dev_disp_text ('leftButton is clicked', 'image', 1, 1, 'black', [], [])
endif
get_mposition (WindowHandle, Row, Column, Button)
get_mposition_sub_pix (WindowHandle, Row, Column, Button)
query_mshape (WindowHandle, ShapeNames)
get_mshape (WindowHandle, Cursor)
set_mshape (WindowHandle, 'crosshair')
open_window(1, 1, 512, 512, WindowHandle, 'buffer', '',WindowHandle1)
send_mouse_double_click_event (WindowHandle1, 1, 1, 1, Processed)
send_mouse_down_event (WindowHandle1, 1, 1, 1,Processed)
send_mouse_up_event (WindowHandle1, 1, 1, 1, Processed)
send_mouse_drag_event (WindowHandle1, 1, 1, 1,Processed)
帖子为视频教程部分内容,
可以下载教程学习。
[halcon]1[/halcon]
[MFC408]1[/MFC408]
[weixinlianxi]1[/weixinlianxi]







欢迎光临 工控编程吧 (https://www.gkbc8.com/) Powered by Discuz! X3.4