图形窗口显示字体文本算子disp_message,dev_disp_text,write_string
read_image (Image33, 'E:/Halcon数据/资源图片/33.png')
dev_get_window (WindowHandle)
//查询系统字体
query_font (WindowHandle, Font)
FontWithSize := Font[0]+'-20'
get_image_size (Image33, Width, Height)
R:=Height/2-300
C:=Width/2-300
//设置字体
set_font (WindowHandle, FontWithSize)
get_system_time (MSecond, Second, Minute, Hour, Day, YDay, Month, Year)
str1:=Year+'年/'+Month+'月'
dev_disp_text (str1, 'window', R, C, 'black', [], [])
wait_seconds (1)
R1:=Height/2-200
C1:=Width/2-300
FontWithStyleAndSize := Font[0]+'-Bold-30'
set_font (WindowHandle, FontWithStyleAndSize)
get_system_time (MSecond, Second, Minute, Hour, Day, YDay, Month, Year)
str2:=Year+'年/'+Month+'月'
dev_disp_text (str2, 'window', R1, C1, 'black', [], [])
wait_seconds (1)
R2:=Height/2-100
C2:=Width/2-250
set_tposition (WindowHandle, R2, C2)
get_system_time (MSecond, Second, Minute, Hour, Day, YDay, Month, Year)
str3:=Year+'年/'+Month+'月'
write_string (WindowHandle, str3)
wait_seconds (1)
R3:=Height/2
C3:=Width/2-300
get_system_time (MSecond, Second, Minute, Hour, Day, YDay, Month, Year)
str4:=Year+'年/'+Month+'月'
disp_message (WindowHandle, str4, 'window', R3, C3, 'green', 'false')