其语法为set_font(WindowHandle, Font),其中WindowHandle是窗口句柄,Font是字体字符串,格式为FONTNAME[-STYLE]-FONT_SIZE。 例如,要将字体设置为Arial加粗20号,可以使用set_font(WindowHandle, 'Arial-Bold-20')。 查询系统支持的字体: 在设置字体之前,可以使用query_font算子查
query_font— Query the available fonts. Signature Description query_fontqueries the fonts available for text output in the output window. They can be set with the operatorset_fontusing the appropriate syntax. Fonts are used by the operatorswrite_string,read_char,read_stringandnew_line. ...
()); QueryFont(hv_WindowHandle, &hv_Font); //返回可用字体 //参数2:返回可用字体 //['Arial', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', //'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic', 'Gabriola', //'...
在我们用halcon导出set_font函数时,出现报错无法使用;通过比对,发现问题,在此进行分享一下 1、 在halcon中进行字体书写时用到set_font函数。 set_font( : : WindowHandle, Font : ) 2、 在halcon改变字体设置例子: dev_get_window (WindowHandle) query_font (WindowHandle, Font) * Specify font name and...
字体不正确,可以先用query_font查询下系统支持字体;设置字体格式:FONTNAME[-STYLE]-FONT_SIZE (...
query_font (WindowHandle, Font) *返回可用字体 *参数2:返回可用字体 *['Arial', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', *'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic', 'Gabriola', ...
query_font (WindowHandle, Font) *FontWithSize := Font[0]+'-18' *set_font(WindowHandle, FontWithSize) set_display_font (WindowHandle, 15, 'mono', 'true', 'true') Length := 80 for index := 0 to |Phi|-1 by 1 set_tposition(WindowHandle, Row[index], Column[index]) dev_set_co...
query_font (WindowHandle, Font) *FontWithSize := Font[0]+'-18' *set_font(WindowHandle, FontWithSize) set_display_font (WindowHandle, 15, 'mono', 'true', 'true') Length := 80 for index := 0 to |Phi|-1 by 1 set_tposition(WindowHandle, Row[index], Column[index]) ...
set_font算子可重入,适合多线程环境中处理文本显示,适合在多个线程中处理图像并同时显示文本的应用场景。► 相关算子介绍 get_font:此算子专为获取当前已设定的字体而设计。query_font:此功能允许查询当前窗口所支持的全部字体。open_window:用于开启图像显示窗口,并返回一个窗口句柄。dev_disp_text:负责在指定...
HTuple hFonts = hWindowControl1.HalconWindow.QueryFont();//可以在窗体设置的字体列表stringFontStr = hFonts.TupleSelect(0);//选择第一个字体intsize =80;//设置字体大小hWindowControl1.HalconWindow.SetFont(string.Format("{0}-Bold-{1}", FontStr, size)); ...