图形对象可以是图像,区域或XLD形式,HALCON额外提供有很多函数与用户交互工作。
实现对图形对象的操作,然后再将操作的图形对象在后续中使用。
这些函数有:
attach_background_to_window get_window_background_image
detach_background_from_window
create_drawing_object_circle create_drawing_object_circle_sector
create_drawing_object_ellipse create_drawing_object_ellipse_sector
create_drawing_object_line create_drawing_object_rectangle1
create_drawing_object_rectangle2 create_drawing_object_text
create_drawing_object_xld attach_drawing_object_to_window
detach_drawing_object_from_window get_drawing_object_iconic
set_drawing_object_params get_drawing_object_params
set_drawing_object_xld clear_drawing_object
set_content_update_callback
set_drawing_object_callback
实例
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image(ImageGB, '1.jpg')
dev_clear_window ()
attach_background_to_window (ImageGB,WindowHandle )
read_image (Image, 'printer_chip/printer_chip_01')
dev_display (Image)
dev_clear_obj (Image)
dev_clear_window ()
get_window_background_image (BackgroundImage, WindowHandle)
detach_background_from_window (WindowHandle)
create_drawing_object_circle (100, 100, 80, DrawID)
create_drawing_object_circle_sector (100, 100, 80, 0, 3.14159, DrawID1)
create_drawing_object_ellipse (200, 200, 0, 100, 60, DrawID2)
create_drawing_object_ellipse_sector (200, 200, 0, 100, 60, 0, 3.14159, DrawID3)
create_drawing_object_line (100, 100, 200, 200, DrawID4)
create_drawing_object_rectangle1 (100, 100, 200, 200, DrawID5)
create_drawing_object_rectangle2 (150, 150, 0, 100, 100, DrawID6)
create_drawing_object_text (12, 12, 'Text', DrawID7)
create_drawing_object_xld ([100,200,200,100], [100,100,200,200], DrawID8)
attach_drawing_object_to_window (WindowHandle, DrawID1)
detach_drawing_object_from_window (WindowHandle, DrawID1)
get_drawing_object_iconic (Object, DrawID1)
gen_cross_contour_xld (Cross, 500, 500, 100, 0.785398)
set_drawing_object_xld (Cross, DrawID8)
attach_drawing_object_to_window (WindowHandle, DrawID8)
set_drawing_object_params (DrawID1, 'color', 'green')
get_drawing_object_params (DrawID1, 'color', GenParamValue)
detach_drawing_object_from_window (WindowHandle, DrawID1)
clear_drawing_object (DrawID1)
帖子为视频教程部分内容,
可以下载教程学习。
上位机VC MFC程序开发精典实例大全源码与视频讲解配套下载408例 经历1年的编程与录制点击进入查看
如果您认可,可联系功能定制! 如果您着急,充值会员可直接联系发您资料!
|