Hi, create a CStatic control and choose type 'rectangle'. Use the following code to draw into that window.
void DrawBitmap(CBitmap* pBitmap, CWnd* pWindow, CPoint Offset)
{
// get bitmap information
BITMAP bmpInfo;
pBitmap->GetObject(sizeof(bmpInfo), &bmpInfo);
// get source size
CSize srcSize;
srcSize.cx = bmpInfo.bmWidth;
srcSize.cy = bmpInfo.bmHeight;
// get window's client device context
CClientDC\* pDC = new CClientDC(pWindow);
// create compatible divice context for stretching
CDC\* memDC = new CDC; memDC->CreateCompatibleDC(pDC);
// load bitmap in original size
CBitmap\* old = memDC->SelectObject(pBitmap);
// copy bitmap data
pDC->BitBlt(Offset.x, Offset.y, srcSize.cx, srcSize.cy, memDC, 0, 0, SRCCOPY);
// reselect first bitmap
memDC->SelectObject(old);
// delete device context and reset pointer
delete memDC; memDC = 0;
// delete device context and reset pointer
delete pDC; pDC = 0;
}
Regards If I have seen further, it is by standing on the shoulders of giants. Isaac Newton