第一种:
ImagePath := []
ImagePath[0] := 'D:/halcon_test/读取多张图片的方式/1.jpg'
ImagePath[1] := 'D:/halcon_test/读取多张图片的方式/2.jpg'
ImagePath[2] := 'D:/halcon_test/读取多张图片的方式/3.jpg'
ImagePath[3] := 'D:/halcon_test/读取多张图片的方式/4.jpg'
ImagePath[4] := 'D:/halcon_test/读取多张图片的方式/5.jpg'
for Index := 0 to 4 by 1
dev_close_window ()
read_image (Image, ImagePath[Index])
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_display (Image)
endfor
第二种:
for i := 1 to 5 by 1
dev_close_window ()
read_image (Image, 'D:/halcon_test/读取多张图片的方式/'+i+'.jpg')
get_image_size (Image, Width, Height)
dev_open_window (0, 0, Width, Height, 'black