#include "stdafx.h"
#include "HCMovingCircles.h"
#include "SnapshotWnd.h"
#include "Resource.h"

void HCMovingCircles::onSnapshot() {
    CRect R;
    pWnd->GetClientRect(&R);
    CClientDC dc(pWnd);
    CDC memDC;
    CBitmap *bmp = new CBitmap();
    bmp->CreateCompatibleBitmap(&dc,R.Width(),R.Height());
    memDC.CreateCompatibleDC(&dc);
    CBitmap *oldBitmap = memDC.SelectObject(bmp);
    memDC.BitBlt(0,0,R.Width(),R.Height(),&dc,R.left,R.top,
                    SRCCOPY);
    memDC.SelectObject(oldBitmap);
    CSnapshotWnd snapWnd(pWnd,bmp);
    snapWnd.DoModal();
}
