Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How can I get the bitmap in the web browser of my formview?

0 views
Skip to first unread message

Jakein2006

unread,
Jan 19, 2007, 3:19:55 PM1/19/07
to
I want to use the following codes to get the image in a web browser inside a
invisible formview, but what I got is the bitmap of the Desktop, please tell
me how should I change to get the image of the web browser inside the
formview?

I apprecaite your help.

CRect SrcRect;
m_pWebCtrl->GetWindowRect(&SrcRect);
HDC hSrcDC, hMemDC;
HBITMAP hBitmap, hOldBitmap;

int nWidth, nHeight;
m_pWebCtrl->Invalidate();

hSrcDC=m_pWebCtrl->GetDC()->m_hDC;

// hSrcDC=m_pWebCtrl->GetWindowDC()->m_hDC;

hMemDC = CreateCompatibleDC(hSrcDC);
nWidth = SrcRect.Width();
nHeight = SrcRect.Height();
hBitmap = CreateCompatibleBitmap(hSrcDC, nWidth, nHeight);

hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);//
BitBlt(hMemDC, 0, 0, nWidth, nHeight,hSrcDC, 0, 0, SRCCOPY); //
hBitmap = (HBITMAP)SelectObject(hMemDC, hOldBitmap);
m_hBitmap=hBitmap;
// m_hBitmap=hOldBitmap;


DeleteDC(hSrcDC);
DeleteDC(hMemDC);


--
jake

0 new messages