Daws
March 29th, 1999, 09:05 AM
Hi
I am trying to capture a specific window and copy it to a bitmap
My problem is that I only want to capture the window not windows which is ontop of it....
I have used the code in article "Printing from a CFormView"
my code look like this...
CClientDC dc(this);
if (m_pMemDC->GetSafeHdc()) m_pMemDC->DeleteDC();
m_pMemDC->CreateCompatibleDC(&dc);
CRect rect;
GetClientRect(rect);
if (m_pBm->GetSafeHandle()) m_pBm->DeleteObject();
m_pBm->CreateCompatibleBitmap(&dc,rect.Width(),rect.Height());
m_pMemDC->SelectObject(m_pBm);
dc.DPtoLP(rect); //Convert to Logical Coordinates
m_rect = rect; //Save Logical Coordinates
m_pMemDC->BitBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,SRCCOPY);
The problem is that windows which is ontop of my window will be captured into my bitmap.
Thanks
/David
I am trying to capture a specific window and copy it to a bitmap
My problem is that I only want to capture the window not windows which is ontop of it....
I have used the code in article "Printing from a CFormView"
my code look like this...
CClientDC dc(this);
if (m_pMemDC->GetSafeHdc()) m_pMemDC->DeleteDC();
m_pMemDC->CreateCompatibleDC(&dc);
CRect rect;
GetClientRect(rect);
if (m_pBm->GetSafeHandle()) m_pBm->DeleteObject();
m_pBm->CreateCompatibleBitmap(&dc,rect.Width(),rect.Height());
m_pMemDC->SelectObject(m_pBm);
dc.DPtoLP(rect); //Convert to Logical Coordinates
m_rect = rect; //Save Logical Coordinates
m_pMemDC->BitBlt(0,0,rect.Width(),rect.Height(),&dc,0,0,SRCCOPY);
The problem is that windows which is ontop of my window will be captured into my bitmap.
Thanks
/David