Halcon 图形窗口显示字体文本

图形窗口显示字体文本算子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')


 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值