查看: 24|回复: 0

Halcon常用数据类型分析

[复制链接]

256

主题

1

回帖

1305

积分

管理员

积分
1305
QQ
发表于 2025-7-2 13:24:14 | 显示全部楼层 |阅读模式
  1. <font size="3">*图像类型

  2. read_image (Image1, 'printer_chip/printer_chip_01') 图像

  3. gen_rectangle1 (Rectangle, 30, 20, 100, 200) 区域

  4. gen_rectangle2_contour_xld (Rectangle1, 300, 200, 0, 100.5, 20.5) 轮廓

  5. get_image_size (Image1, Width, Height) 获取图像尺寸


  6. *控制类型

  7. str:='thinger'

  8. num:=123

  9. num2:=200

  10. val:=123.456

  11. array:=[1,2,3,4,5]

  12. dev_get_window (WindowHandle) 获取窗体句柄

  13. *运算符

  14. if(num<200)
  15.    
  16.     stop ()
  17.    
  18. else
  19.     stop ()
  20.       
  21. endif



  22. if(num>123 and num2<300)
  23.      stop ()
  24. else
  25.     stop ()   
  26. endif



  27. if(num>123 or num2<300)
  28.      stop ()
  29. else
  30.     stop ()   
  31. endif


  32. if(not(num>123 or num2<300))
  33.      stop ()
  34. else
  35.     stop ()   
  36. endif



  37. *控制流

  38. for Index := 1 to 5 by 1
  39.    num:=num+1
  40. endfor


  41. while (num>100)
  42.    
  43.     num:=num-1
  44.    
  45. endwhile


  46. switch (num)
  47. case 1:
  48.     break
  49. case 100:
  50.     stop ()
  51. endswitch


  52. for Index1 := 1 to 5 by 1
  53.     continue
  54. endfor</font>
复制代码


高级模式
B Color Image Link Quote Code Smilies

本版积分规则

关于我们

企业文化

人才招聘

常见问题

建议反馈

合作伙伴

商务合作

新闻媒体

产品服务

客户案例

联系我们

联系电话:14776878570(同VX号)

邮箱:14776878570@163.com(同VX号)

工作时间:周一至周六(早上8点至下午10点)

关注微信公众号

QQ|Archiver|手机版|小黑屋|鸿翔机器人

GMT+8, 2025-8-6 18:26 , Processed in 0.065074 second(s), 18 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2025 Discuz! Team.