Re: using CClientDC::BitBlt() to capture only the client window
It doesn't appear that you are restricting the capture area to your client
window.
However, I would not take this approach. I would create a bitmap in memory.
When an edit is made, update the bitmap and then refill the client area with
that bitmap. Otherwise, if you need to save the bitmap when the entire
bitmap is not visible on the screen, you won't be able to save the entire
bitmap.
--
Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com
http://www.softcircuits.com/blog/
"nexolite" <nexolite@discussions.microsoft.com> wrote in message
news:B529F553-FDCB-4D9E-9805-4431EBED06C6@microsoft.com...
Hi,
I am trying to create a application similar to MS paint , so I am using
BitBlt() to capture the drawing area that is the window of my application,
I
did the following:
*To Capture the scrren*
CClientDC dcMemory;
CRect rect;
GetClientRect(&rect);
dcMemory.BitBlt(rect.TopLeft().x,rect.TopLeft().y,rect.Width(),rect.Height(),NULL,rect.TopLeft().x,rect.TopLeft().y,SRCCOPY);
*To display the screen back*
CClientDC dc(this);
CRect rect;
GetClientRect(&rect);
dc.BitBlt(rect.TopLeft().x,rect.TopLeft().y,rect.Width(),rect.Height(),&dcMemory,rect.TopLeft().x,rect.TopLeft().y,SRCCOPY);
Now what happens is that the complete screen, the screen including the
portion that is outside my application window gets drawn into the
application
window ,so what must be done so that it captures the screen area of my
application window only?