m_pBMI1->bmiHeader.biYPelsPerMeter=0;
////////////////////////////////////////////////////////////////////////
pData2=(BYTE*)new char[biWidth1*biHeight1 *3];//申请存放小图像的缓冲区
Read(pData2,biWidth1*biHeight1 *3);////向该缓冲区读数据
m_pBMI2= new BITMAPINFO;
m_pBMI2->bmiHeader.biBitCount=24;
m_pBMI2->bmiHeader.biClrImportant=0;
m_pBMI2->bmiHeader.biClrUsed=0;
m_pBMI2->bmiHeader.biCompression=0;
m_pBMI2->bmiHeader.biHeight=biHeight1;
m_pBMI2->bmiHeader.biPlanes=1;
m_pBMI2->bmiHeader.biSize=40;
m_pBMI2->bmiHeader.biSizeImage=WIDTHBYTES(biWidth1*8)*biHeight1*3;
m_pBMI2->bmiHeader.biWidth=biWidth1;
m_pBMI2->bmiHeader.biXPelsPerMeter=0;
m_pBMI2->bmiHeader.biYPelsPerMeter=0;
//下面实现画中画的显示
CDC MemDc;
MemDc.CreateCompatibleDC(&dc);
bitmap.CreateCompatibleBitmap(&dc,biWidth,biHeight);
oldmap=MemDc.SelectObject(&bitmap);
::StretchDIBits(MemDc.m_hDC,0,0,biWidth,biHeight,0,0,—biWidth,biHeight,pData1,m_pBMI1,DIB_RGB_COLORS,SRCCOPY);//首先将大图像画在内寸上下文中
::StretchDIBits(MemDc.m_hDC,20,20,biWidth1,biHeight1,_
0,0,biWidth1,biHeight1,pData2,m_pBMI2,DIB_RGB_COLORS,SRCCOPY);//再将小图像画在内寸上下文中
::StretchBlt(dc.m_hDC,0,0,bih.biWidth,bih.biHeight,_
MemDc.m_hDC,0,0,bih.biWidth,bih.biHeight,SRCCOPY);//将结果显示在屏幕上。
MemDc.SelectObject(oldmap);
delete pData1;
delete m_pBMI1;
delete pData2;
delete m_pBMI2;
}