Tuple


1、含義:Halcon的值類型,Tuple類型變量可以存儲int、double、一維數組等。  

 

 

 2、存儲與讀取:  

  

read_image (Image, 'printer_chip/printer_chip_01')
get_image_size (Image, Width, Height)
*Write Tuple
write_tuple (Height, 'C:/Users/49112/Desktop/Height.tup')
write_tuple (Height, 'C:/Users/49112/Desktop/Width.tup')
*Read Tuple
read_tuple ('C:/Users/49112/Desktop/Width.tup', WidthRead)
read_tuple ('C:/Users/49112/Desktop/Height.tup', HeightRead)
*Display Width&Height
Message:='Width: '+WidthRead+'\nHeight: '+HeightRead
dev_close_window ()
dev_open_window (0, 0, Width/2, Height/2, 'black', WindowHandle)
dev_display (Image)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
disp_message (WindowHandle, Message, 'image', 12, 12, 'black', 'true')
Halcon Code

 

  運行結果:

  

 

 

  Tuple文件:

    打開Width.tup,內容如下:

 

   

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM