Даю код функции , где ... все понятно
BYTE *pBuffer;
int dwLength - размер картинки
pBuffer - указатель на Ваш буфер.
HBITMAP phBitmap;
HWND hWnd_Wnd;
hWnd_Wnd=GetDlgItem(IDS_FOTO)->m_hWnd; // окно в диалоговом окне
CRect Rect_Wnd;
::GetWindowRect(hWnd_Wnd,&Rect_Wnd);
int R_X=Rect_Wnd.right-Rect_Wnd.left;
int R_Y=Rect_Wnd.bottom-Rect_Wnd.top;
///////////////////////////////////////////////////
PAINTSTRUCT paintstruct;
BITMAP bitmap;
HDC hdc = ::BeginPaint(hWnd_Wnd, &paintstruct);
HDC hdcMemory = CreateCompatibleDC(hdc);
phBitmap=LoadBitmapFromMemory(pBuffer,hdc);
HGDIOBJ oldBitmap = SelectObject(hdcMemory, phBitmap);
GetObject(phBitmap, sizeof(bitmap), &bitmap);
StretchBlt(hdc,0,0,R_X,R_Y,hdcMemory,0,0,bitmap.bmWidth,bitmap.bmHeight,SRCCOPY)
;
SelectObject(hdcMemory, oldBitmap);
DeleteDC(hdcMemory);
::EndPaint(hWnd_Wnd, &paintstruct);
////////////////////////////////
free (pBuffer);pBuffer=NULL;
DeleteObject(phBitmap);
DeleteDC(hdcMemory);