You should override OnDraw() Function in Your CWnd-derived class.
An example for a Bitmap with Handle hBitmap (created with CreateBitmap(), CreateDIBitmap() etc.):
HBITMAP AnyFunktion()
{
...
HBITMAP hBitmap = CreateDIBitmap(...); //Get Your Bitmap Handle
...
return hBitmap;
}
void CMyView::OnDraw(CDC* pDC)
{
HDC hdcMem = CreateCompatibleDC(pDC->m_hDC);
if(hdcMem) {
RECT rct;
GetClientRect(&rct);
HGDIOBJ hobj = SelectObject(hdcMem,hBitmap);
if(hobj) {
CPoint pnt = GetScrollPosition( ); //If the Bitmap is biggeras View
BitBlt(pDC->m_hDC, pnt.x, pnt.y, pnt.x + rct.right, pnt.y + rct.bottom, hdcMem, pnt.x, pnt.y, SRCCOPY);
}
DeleteDC(hdcMem);
}
}
Do not forget DeleteObject(hBitmap) after You do not need it more.
Do not create or delete Bitmap in OnDraw() - it makes Your Program slow.