我是小小小小鸟,大家帮帮我! 先用CFile 文件打开这.bmp文件把文件的指针a指相他。定义一个CBITMAP类用这个类的装载函数加载指针a的这个bmp文件。这样就可以打开位图了。至于保存则可以用CFile这个类的copy和remove等函数。由于我在网吧上网手头没有源码如果要源码可以写信我 ......[email protected] 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 关注!!我曾有同样的一个例似的问题,用CFileDialog预览工程图片.至今没结果.关注,希望得到启示 :) static char BASED_CODE szFilter[] = "24位位图 (*.bmp)|*.bmp||";CFileDialog m_ldFile(TRUE, ".bmp", m_strSelfTexture, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);if(m_ldFile.DoModal() == IDOK){ m_strSelfTexture = m_ldFile.GetPathName();char * chTexture= (char*)(LPCSTR)m_strSelfTexture;/////////////////////////////////////////////CFile file; CString msg;if(!file.Open(chTexture, CFile::modeRead)){msg.Format("Failed to open %s.", chTexture);AfxMessageBox(msg);}UINT nBytes = file.GetLength(); file.Read(&header, sizeof(BITMAPFILEHEADER));if( header.bfType != 'MB'){msg.Format("%s is not a bmp file.", chTexture);AfxMessageBox(msg);}file.Read(&infoHeader, sizeof(BITMAPINFOHEADER));if(infoHeader.biBitCount != 24){msg.Format("%s is not a 24 bytes bmp file.", chTexture);AfxMessageBox(msg);}file.Seek(header.bfOffBits, CFile::begin); data = new unsigned char[infoHeader.biSizeImage]; file.ReadHuge(data, infoHeader.biSizeImage);只是打开24位位图的! 关于cv6.0安装 回调数据与画图函数绘图不同步 在线等:CEditView不能自动刷新 请问在Csdn论坛里知道一个博主的名字, 如何查找到他的博客呢 结构体指针参数问题 请哪介绍一下bcp_*函数族的用法 关于三角函数的问题!!!! m_DateStart.Format("%Y-%m-%D")函数得不到“日”为哪般? CreateThread函数中如何使用security_attriute 参数 我急需一个图像配准的程序,希望大家能帮忙 谁知道好的图书下载站点,在线等待 有关视图滚动问题?
我曾有同样的一个例似的问题,用CFileDialog预览工程图片.至今没结果.关注,希望得到启示 :)
CFileDialog m_ldFile(TRUE, ".bmp", m_strSelfTexture, OFN_HIDEREADONLY |
OFN_OVERWRITEPROMPT, szFilter);
if(m_ldFile.DoModal() == IDOK)
{
m_strSelfTexture = m_ldFile.GetPathName();
char * chTexture= (char*)(LPCSTR)m_strSelfTexture;
/////////////////////////////////////////////
CFile file; CString msg;
if(!file.Open(chTexture, CFile::modeRead))
{
msg.Format("Failed to open %s.", chTexture);
AfxMessageBox(msg);
}
UINT nBytes = file.GetLength();
file.Read(&header, sizeof(BITMAPFILEHEADER));
if( header.bfType != 'MB')
{
msg.Format("%s is not a bmp file.", chTexture);
AfxMessageBox(msg);
}
file.Read(&infoHeader, sizeof(BITMAPINFOHEADER));
if(infoHeader.biBitCount != 24)
{
msg.Format("%s is not a 24 bytes bmp file.", chTexture);
AfxMessageBox(msg);
}
file.Seek(header.bfOffBits, CFile::begin);
data = new unsigned char[infoHeader.biSizeImage];
file.ReadHuge(data, infoHeader.biSizeImage);
只是打开24位位图的!