关于自动读取bmp文件 请问这样的功能应该如何实现,用文档视图结构,从指定文件夹中读取一张bmp图片,显示并处理后自动读取下一张图片并进行处理,直到文件夹里的图片全部处理完毕。谢谢。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个简单,把文件名命名的有规律,根据规律的文件名依次读取就完了,比如1.bmp 2。bmp ,3。bmp 当然楼上的是好办法 首先要搞清楚位图文件的格式。接着搞清楚VC中文件读写的相关函数。然后弄懂怎么遍历文件夹中的文件。最后弄清楚怎么在MFC框架中添加菜单响应。 读BMP文件不用知道格式吧,用LoadImage就行了。 http://topic.csdn.net/u/20100502/11/aa4cb649-2fdf-4356-bd41-db569e13030f.html这是我发的帖子, CString pathname , froot ,filename , path , f_name; BOOL bResult ; CFile file ; CFileDialog dlg(TRUE, NULL, NULL,OFN_HIDEREADONLY,"*.bmp|*.bmp|All Files(*.*)|*.*||") ; if(dlg.DoModal() == IDOK) { pathname = dlg.GetPathName() ; CFileFind finder ; finder.FindFile(pathname) ; finder.FindNextFile() ; froot = finder.GetRoot() ; CString root = froot ; pathname = froot+"\\*.*" ; bResult = finder.FindFile(pathname) ; while (bResult) { bResult = finder.FindNextFile() ; if(finder.IsDots()) continue ; if(finder.IsDirectory()) continue ; filename = finder.GetFileName() ; if("bmp" != filename.Right(3) && "BMP" != filename.Right(3)) continue ; path = finder.GetFilePath() ;}} 经常写了的程序 过个一个月没动 就不爱续写了 有人跟我一样的毛病吗 设计视图如何快速切换到代码视图(net2005) 如何获取windows桌面上的鼠标事件。 头文件的添加 非模态对话框的显示问题 求救!vc 客户端的socket 与 java服务器 通信失败。sos!!! 问 vs 开发的ocx控件在excel里点设计模式切换时绘制出错!! MoveWindow()用指针调用不起作用,在窗口内部调用起作用 欢迎大家来讨论“COM+松耦合事件”方面的问题,我会加分的。 怎么样用声卡将数字波形直接输出为真实声音?不用wav文件的方式 想问问做一些小游戏或者网页版的小游戏最主要什么语言
当然楼上的是好办法
接着搞清楚VC中文件读写的相关函数。
然后弄懂怎么遍历文件夹中的文件。
最后弄清楚怎么在MFC框架中添加菜单响应。
BOOL bResult ;
CFile file ; CFileDialog dlg(TRUE, NULL, NULL,OFN_HIDEREADONLY,"*.bmp|*.bmp|All Files(*.*)|*.*||") ;
if(dlg.DoModal() == IDOK)
{
pathname = dlg.GetPathName() ;
CFileFind finder ;
finder.FindFile(pathname) ;
finder.FindNextFile() ;
froot = finder.GetRoot() ;
CString root = froot ;
pathname = froot+"\\*.*" ;
bResult = finder.FindFile(pathname) ;
while (bResult)
{
bResult = finder.FindNextFile() ;
if(finder.IsDots())
continue ;
if(finder.IsDirectory())
continue ;
filename = finder.GetFileName() ;
if("bmp" != filename.Right(3) && "BMP" != filename.Right(3))
continue ;
path = finder.GetFilePath() ;
}
}