BOOL CopyCBitmapFromSrc(CBitmap* pBitmapDest, CBitmap* pBitmapSrc)
{
BOOL bFlag = FALSE;
BITMAP bmpInfo;
// 获取源图信息
pBitmapSrc->GetBitmap(&bmpInfo);
// 求取每一个像素所占的字节
long sizeBits = bmpInfo.bmWidth * bmpInfo.bmHeight * ( bmpInfo.bmWidthBytes / bmpInfo.bmWidth );
// 分配内存
PBYTE pBits = new BYTE[ sizeBits ];
ZeroMemory(pBits, sizeBits);
// 保存源图像素信息
pBitmapSrc->GetBitmapBits(sizeBits, pBits);
// 创建新图
bFlag = pBitmapDest->CreateBitmap(bmpInfo.bmWidth, bmpInfo.bmHeight, bmpInfo.bmPlanes, bmpInfo.bmBitsPixel, pBits);
// 回收资源
delete []pBits;
return bFlag;
}