请选择 进入手机版 | 继续访问电脑版

Hello Mat

 找回密码
 立即注册
查看: 7267|回复: 1

选择1个文件夹并加载显示全部文件到listbox

[复制链接]

1294

主题

1520

帖子

110

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22633
发表于 2019-11-27 22:27:11 | 显示全部楼层 |阅读模式
选择1个文件夹并加载显示全部文件到listbox
环境:WIN7 + Halcon12 + x86 + VS2013

  1.             HTuple hv_path = null, hv_ImageFiles = null;
  2.             string FilePath = null, ImagePathWithName = null;
  3.             List<string> ImagePaths = new List<string>();
  4.             // Initialize local and output iconic variables
  5.             FolderBrowserDialog FilesPath = new FolderBrowserDialog();
  6.             if (FilesPath.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  7.             {
  8.                 FilePath = FilesPath.SelectedPath;
  9.                 hv_path = FilePath;
  10.                 Halcon12Funs.list_image_files(hv_path, "default", new HTuple(), out hv_ImageFiles);
  11.                 for (int i = 0; i <= (int)((new HTuple(hv_ImageFiles.TupleLength())) - 1); i++)
  12.                 {
  13.                     ImagePathWithName = hv_ImageFiles.TupleSelect(i);
  14.                     ImagePaths.Add(ImagePathWithName);
  15.                     this.listBox1.Items.Add(ImagePathWithName);
  16.                 }
  17.             }
复制代码





算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-4-18 22:02 , Processed in 0.237579 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表