如何获取屏幕的图象并打印在窗体上?
我想通过复制DC来实现....

解决方案 »

  1.   

    在视图类中
    void CCapView::OnDraw(CDC* pDC)
    {
    CCapDoc* pDoc = GetDocument();
    ASSERT_VALID(pDoc);
    // TODO: add draw code for native data here
    HDC hdc=::GetWindowDC(NULL);
    CDC *dc=CDC::FromHandle(hdc);
    CRect rect;
    GetClientRect(&rect);
    pDC->BitBlt(0,0,rect.right,rect.bottom,dc,0,0,SRCCOPY);
    }
    在框架类中
    void CMainFrame::OnMoving(UINT fwSide, LPRECT pRect) 
    {
    CFrameWnd::OnMoving(fwSide, pRect);

    // TODO: Add your message handler code here
    Invalidate();
    }