資源簡介
VS2008精心仿制QQ界面,純MFC自繪控件打造精美QQ界面,利用雙緩存貼圖技術實現無閃爍移,源碼上傳。如果有建議與問題,請與我聯系。此作品僅作參考,大家一起共同交流學習。若有修改后的成品還請發給我一份,謝謝!

代碼片段和文件信息
/************************************************************************?
*?程序名:????精仿QQ主界面?
*?制作人:????李克平?2011年04月11日
*?版本號:????1.0?
************************************************************************/?
//?EnBitmap.cpp:?implementation?of?the?CEnBitmap?class.
//
//////////////////////////////////////////////////////////////////////
#include?“stdafx.h“
#include?“EnBitmap.h“
#include?
#ifdef?_DEBUG
#undef?THIS_FILE
static?char?THIS_FILE[]=__FILE__;
#define?new?DEBUG_NEW
#endif
const?int?HIMETRIC_INCH =?2540;
enum?
{
FT_BMP
FT_ICO
FT_JPG
FT_GIF
FT_UNKNOWN
};
//////////////////////////////////////////////////////////////////////
//?Construction/Destruction
//////////////////////////////////////////////////////////////////////
CEnBitmap::CEnBitmap()
{
}
CEnBitmap::~CEnBitmap()
{
}
BOOL?CEnBitmap::LoadImage(UINT?uIDRes?LPCTSTR?szResourceType?HMODULE?hInst?COLORREF?crBack)
{
ASSERT(m_hobject?==?NULL);??????//?only?attach?once?detach?on?destroy
if?(m_hobject?!=?NULL)
return?FALSE;
return?Attach(LoadImageResource(uIDRes?szResourceType?hInst?crBack));
}
BOOL?CEnBitmap::LoadImage(LPCTSTR?szImagePath?COLORREF?crBack)
{
//如果原先存在就去除
if?(m_hobject?!=?NULL)
{
Deleteobject();
Detach();
}
return?Attach(LoadImageFile(szImagePath?crBack));
}
HBITMAP?CEnBitmap::LoadImageFile(LPCTSTR?szImagePath?COLORREF?crBack)
{
int?nType?=?GetFileType(szImagePath);
switch?(nType)
{
//?the?reason?for?this?is?that?i?suspect?it?is?more?efficient?to?load
//?bmps?this?way?since?it?avoids?creating?device?contexts?etc?that?the?
//?IPicture?methods?requires.?that?method?however?is?still?valuable
//?since?it?handles?other?image?types?and?transparency
case?FT_BMP:
return?(HBITMAP)::LoadImage(NULL?szImagePath?IMAGE_BITMAP?0?0?LR_LOADFROMFILE);
case?FT_UNKNOWN:
return?NULL;
default:?//?all?the?rest
{
USES_CONVERSION;
IPicture*?pPicture?=?NULL;
HBITMAP?hbm?=?NULL;
HRESULT?hr?=?OleLoadPicturePath(T2OLE(szImagePath)?NULL?0?crBack?IID_IPicture?(LPVOID?*)&pPicture);
if?(pPicture)
{
hbm?=?ExtractBitmap(pPicture?crBack);
pPicture->Release();
}
return?hbm;
}
}
return?NULL;?//?can‘t?get?here
}
HBITMAP?CEnBitmap::LoadImageResource(UINT?uIDRes?LPCTSTR?szResourceType?HMODULE?hInst?COLORREF?crBack)
{
BYTE*?pBuff?=?NULL;
int?nSize?=?0;
HBITMAP?hbm?=?NULL;
//?first?call?is?to?get?buffer?size
if?(GetResource(MAKEINTRESOURCE(uIDRes)?szResourceType?hInst?0?nSize))
{
if?(nSize?>?0)
{
pBuff?=?new?BYTE[nSize];
//?this?loads?it
if?(GetResource(MAKEINTRESOURCE(uIDRes)?szResourceType?hInst?pBuff?nSize))
{
IPicture*?pPicture?=?LoadFromBuffer(pBuff?nSize);
if?(pPicture)
{
hbm?=?ExtractBitmap(pPicture?crBack);
pPicture->Release();
}
}
delete?[]?pBuff;
}
}
r
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2011-04-13?10:50??QQ\
?????目錄???????????0??2011-04-13?10:52??QQ\Bin\
?????目錄???????????0??2011-04-13?10:50??QQ\Bin\NEWFACE\
?????文件????????4856??2007-05-31?18:08??QQ\Bin\NEWFACE\1.bmp
?????文件????????4856??2007-05-31?18:08??QQ\Bin\NEWFACE\10.bmp
?????文件????????4856??2007-05-31?18:08??QQ\Bin\NEWFACE\100.bmp
?????文件????????2680??2007-05-31?18:08??QQ\Bin\NEWFACE\101.bmp
?????文件????????2680??2007-05-31?18:08??QQ\Bin\NEWFACE\102.bmp
?????文件????????2680??2007-05-31?18:08??QQ\Bin\NEWFACE\103.bmp
?????文件????????2680??2007-05-31?18:08??QQ\Bin\NEWFACE\104.bmp
?????文件????????2680??2007-05-31?18:08??QQ\Bin\NEWFACE\105.bmp
?????文件????????6456??2007-05-31?18:17??QQ\Bin\NEWFACE\106.bmp
?????文件????????6456??2007-05-31?18:17??QQ\Bin\NEWFACE\107.bmp
?????文件????????6456??2007-05-31?18:17??QQ\Bin\NEWFACE\108.bmp
?????文件????????6456??2007-05-31?18:17??QQ\Bin\NEWFACE\109.bmp
?????文件????????4856??2007-11-18?09:35??QQ\Bin\NEWFACE\11.bmp
?????文件????????6456??2007-05-31?18:18??QQ\Bin\NEWFACE\110.bmp
?????文件????????6456??2007-05-31?18:18??QQ\Bin\NEWFACE\111.bmp
?????文件????????6456??2007-05-31?18:18??QQ\Bin\NEWFACE\112.bmp
?????文件????????4856??2007-05-31?18:19??QQ\Bin\NEWFACE\113.bmp
?????文件????????4856??2007-05-31?18:19??QQ\Bin\NEWFACE\114.bmp
?????文件????????4856??2007-05-31?18:20??QQ\Bin\NEWFACE\115.bmp
?????文件????????4856??2007-05-31?18:19??QQ\Bin\NEWFACE\116.bmp
?????文件????????4856??2007-05-31?18:19??QQ\Bin\NEWFACE\117.bmp
?????文件????????2676??2007-07-30?21:47??QQ\Bin\NEWFACE\118.bmp
?????文件????????2676??2007-07-30?21:46??QQ\Bin\NEWFACE\119.bmp
?????文件????????4856??2007-05-31?18:08??QQ\Bin\NEWFACE\12.bmp
?????文件????????2672??2007-07-30?21:46??QQ\Bin\NEWFACE\120.bmp
?????文件????????2676??2007-07-30?21:46??QQ\Bin\NEWFACE\121.bmp
?????文件????????2676??2007-07-30?21:46??QQ\Bin\NEWFACE\122.bmp
?????文件????????2676??2007-07-30?21:47??QQ\Bin\NEWFACE\123.bmp
............此處省略204個文件信息
評論
共有 條評論