資源簡介
visual c++數字圖像處理(何斌)光盤源代碼

代碼片段和文件信息
//?cdib.cpp
//?new?version?for?WIN32
#include?“stdafx.h“
#include?“cdib.h“
#ifdef?_DEBUG
#define?new?DEBUG_NEW
#undef?THIS_FILE
static?char?THIS_FILE[]?=?__FILE__;
#endif
IMPLEMENT_SERIAL(CDib?Cobject?0);
CDib::CDib()
{
m_hFile?=?NULL;
m_hBitmap?=?NULL;
m_hPalette?=?NULL;
m_nBmihAlloc?=?m_nImageAlloc?=?noAlloc;
Empty();
}
CDib::CDib(CSize?size?int?nBitCount)
{
m_hFile?=?NULL;
m_hBitmap?=?NULL;
m_hPalette?=?NULL;
m_nBmihAlloc?=?m_nImageAlloc?=?noAlloc;
Empty();
ComputePaletteSize(nBitCount);
m_lpBMIH?=?(LPBITMAPINFOHEADER)?new?
char[sizeof(BITMAPINFOHEADER)?+?sizeof(RGBQUAD)?*?m_nColorTableEntries];
m_nBmihAlloc?=?crtAlloc;
m_lpBMIH->biSize?=?sizeof(BITMAPINFOHEADER);
m_lpBMIH->biWidth?=?size.cx;
m_lpBMIH->biHeight?=?size.cy;
m_lpBMIH->biPlanes?=?1;
m_lpBMIH->biBitCount?=?nBitCount;
m_lpBMIH->biCompression?=?BI_RGB;
m_lpBMIH->biSizeImage?=?0;
m_lpBMIH->biXPelsPerMeter?=?0;
m_lpBMIH->biYPelsPerMeter?=?0;
m_lpBMIH->biClrUsed?=?m_nColorTableEntries;
m_lpBMIH->biClrImportant?=?m_nColorTableEntries;
ComputeMetrics();
memset(m_lpvColorTable?0?sizeof(RGBQUAD)?*?m_nColorTableEntries);
m_lpImage?=?NULL;??//?no?data?yet
}
CDib::~CDib()
{
Empty();
}
CSize?CDib::GetDimensions()
{
if(m_lpBMIH?==?NULL)?return?CSize(0?0);
return?CSize((int)?m_lpBMIH->biWidth?(int)?m_lpBMIH->biHeight);
}
BOOL?CDib::AttachMapFile(const?char*?strPathname?BOOL?bShare)?//?for?reading
{
//?if?we?open?the?same?file?twice?Windows?treats?it?as?2?separate?files
//?doesn‘t?work?with?rare?BMP?files?where?#?palette?entries?>?biClrUsed
HANDLE?hFile?=?::CreateFile(strPathname?GENERIC_WRITE?|?GENERIC_READ
bShare???FILE_SHARE_READ?:?0
NULL?OPEN_EXISTING?FILE_ATTRIBUTE_NORMAL?NULL);
ASSERT(hFile?!=?INVALID_HANDLE_VALUE);
DWORD?dwFileSize?=?::GetFileSize(hFile?NULL);
HANDLE?hMap?=?::CreateFileMapping(hFile?NULL?PAGE_READWRITE?0?0?NULL);
DWORD?dwErr?=?::GetLastError();
if(hMap?==?NULL)
{
AfxMessageBox(“Empty?bitmap?file“);
return?FALSE;
}
LPVOID?lpvFile?=?::MapViewOfFile(hMap?FILE_MAP_WRITE?0?0?0);?//?map?whole?file
ASSERT(lpvFile?!=?NULL);
if(((LPBITMAPFILEHEADER)?lpvFile)->bfType?!=?0x4d42)
{
AfxMessageBox(“Invalid?bitmap?file“);
DetachMapFile();
return?FALSE;
}
AttachMemory((LPBYTE)?lpvFile?+?sizeof(BITMAPFILEHEADER));
m_lpvFile?=?lpvFile;
m_hFile?=?hFile;
m_hMap?=?hMap;
return?TRUE;
}
BOOL?CDib::CopyToMapFile(const?char*?strPathname)
{
//?copies?DIB?to?a?new?file?releases?prior?pointers
//?if?you?previously?used?CreateSection?the?HBITMAP?will?be?NULL?(and?unusable)
BITMAPFILEHEADER?bmfh;
bmfh.bfType?=?0x4d42;??//?‘BM‘
bmfh.bfSize?=?m_dwSizeImage?+?sizeof(BITMAPINFOHEADER)?+
sizeof(RGBQUAD)?*?m_nColorTableEntries?+?sizeof(BITMAPFILEHEADER);
//?meaning?of?bfSize?open?to?interpretation
bmfh.bfReserved1?=?bmfh.bfReserved2?=?0;
bmfh.bfOffBits?=?sizeof(BITMAPFILEHEADER)?+?sizeof
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????21504??2006-03-16?14:27??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\光盤使用說明.doc
?????文件??????28160??2002-11-12?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\用MFC封裝圖象處理Dll.doc
?????文件??????30449??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Dibapi.cpp
?????文件???????1879??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Dibapi.h
?????文件??????17980??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.aps
?????文件????????334??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.clw
?????文件???????8405??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.cpp
?????文件????????329??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.def
?????文件???????4327??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.dsp
?????文件????????539??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.dsw
?????文件???????1275??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.h
?????文件?????107520??2002-10-08?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.ncb
?????文件??????56832??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.opt
?????文件???????1288??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.plg
?????文件???????3077??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\GeoTrans.rc
?????文件???????2590??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\ReadMe.txt
?????文件????????380??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Resource.h
?????文件????????210??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\StdAfx.cpp
?????文件???????1447??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\StdAfx.h
?????文件??????26949??2002-10-07?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\TransDIB.cpp
?????文件????????917??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\TransDIB.h
?????文件????????400??2002-09-30?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\res\GeoTrans.rc2
?????文件??????23854??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\DIBAPI.obj
?????文件??????????0??2005-03-03?13:58??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\DIBAPI.sbr
?????文件????1347658??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.dll
?????文件???????2225??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.exp
?????文件???????4952??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.lib
?????文件??????20102??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.obj
?????文件????2360320??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.pdb
?????文件???????6828??2004-02-26?00:00??visual?c++數字圖像處理(何斌)光盤源代碼\vc?digital?image?processing?code\封裝的dll\GeoTrans\Debug\GeoTrans.res
............此處省略309個文件信息
評論
共有 條評論