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)
帖子为视频教程部分内容,
可以下载教程学习。
上位机VC MFC程序开发精典实例大全源码与视频讲解配套下载408例 经历1年的编程与录制点击进入查看
如果您认可,可联系功能定制! 如果您着急,充值会员可直接联系发您资料!
|