首页 > 其他 > 详细

批处理文件夹里的图片

时间:2015-03-25 23:37:09      阅读:499      评论:0      收藏:0      [点我收藏+]
// 得到文件夹里的所有图片的名称
bool GetPicDirSetInFolder(CString strFindPath, std::vector<CString> &vecPathSet)
{
	WIN32_FIND_DATA wfd;
	HANDLE hf = FindFirstFileA(strFindPath, &wfd);

	if (INVALID_HANDLE_VALUE != hf)
	{ 
		vecPathSet.push_back(wfd.cFileName);
		while (FindNextFileA(hf, &wfd))
		{
			vecPathSet.push_back(wfd.cFileName);
		}

		FindClose(hf);
	}

	return true;
}


// 批处理函数
bool BatchProcessing(void)
{
	vector<CString> vecPathSet;
	CString findPath = "F:\\images\\*.jpg";
	CString folder = "F:\\images\\";
	CString procFolder = "F:\\save_images\\";
		
	GetPicDirSetInFolder(findPath, vecPathSet);

	for (int iPic = 0; iPic < vecPathSet.size(); iPic ++)
	{
		CString path = folder;
		path.Append(vecPathSet[iPic]); // load_img_path
		CString save_path_result = procFolder;
		save_path_result.Append(vecPathSet[iPic]); //save_img_path
		
		// ProcessImage(path, save_img_path); // 进行图像处理
	}
	return true;
}


 

批处理文件夹里的图片

原文:http://blog.csdn.net/u011504498/article/details/44629661

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!