工业视觉halcon图形text函数详细介绍
文本形式的变量可以用于显示一些信息,如几何测量数值,与用户的交互字符串等。
Halcon提供比较全的文本操作函数,
如下
disp_message disp_text
disp_continue_message
disp_end_of_program_message
disp_text_button
query_font set_font get_font
get_font_extents
set_display_font
get_string_extents
write_string set_tposition
get_tposition
new_line
read_char read_string
实例
dev_close_window ()
read_image (Image, 'printer_chip/printer_chip_01')
dev_open_window_fit_image (Rim, 0, 0, -1, -1, WindowHandle)
dev_display (Image)
*disp_text
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
dev_disp_text ('hello', 'image', 12, 12, 'red', ['box'], ['false'])
disp_message (WindowHandle,'gkbc8.com' , 'image', 12, 12, 'red', 'false')
disp_continue_message (WindowHandle, 'black', 'true')
disp_end_of_program_message (WindowHandle, 'black', 'true')
disp_text_button (WindowHandle, 'Text', 'window', 200, 200, 'red', 'green')
dev_clear_window ()
query_font (WindowHandle, Font)
get_font (WindowHandle, Font1)
set_font (WindowHandle, 'Arial-24')
dev_disp_text ('hello', 'image', 12, 12, 'red', ['box'], ['false'])
get_font_extents (WindowHandle, MaxAscent, MaxDescent, MaxWidth, MaxHeight)
get_string_extents (WindowHandle, 'gkbc8.com', Ascent, Descent, Width, Height)
dev_clear_window ()
write_string (WindowHandle, 12)
new_line (WindowHandle)
write_string (WindowHandle, 'gkbc8.com')
new_line (WindowHandle)
get_tposition (WindowHandle, Row, Column)
get_string_extents (WindowHandle, 'gkbc8.com', Ascent, Descent, Width, Height)
set_tposition (WindowHandle, Row+Height, Column+Width*4)
write_string (WindowHandle, 'gkbc8.com')
read_char (WindowHandle, Char, Code)
read_string (WindowHandle, '请输入密码:', 32, OutString)
帖子为视频教程部分内容,
可以下载教程学习。
上位机VC MFC程序开发精典实例大全源码与视频讲解配套下载408例 经历1年的编程与录制点击进入查看
如果您认可,可联系功能定制! 如果您着急,充值会员可直接联系发您资料!
|