因为还想在其上添加其他空间,因为不想使用CEdit之类的画图。图画很简单。多谢!

解决方案 »

  1.   

    在OnPaint函数中,创建位图的CBrush然后填充这个客户区即可。!
      

  2.   


    int CGraphSeeView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
    {
    if (CFormView::OnCreate(lpCreateStruct) == -1)
    return -1;
    m_bitmap.LoadBitmap(IDB_BITMAP_BACKGROUND);
    return 0;
    }
    void CGraphSeeView::OnPaint() 
    {
    CPaintDC dc(this); // device context for painting

    // TODO: Add your message handler code here
    CRect rect;
    GetClientRect(rect); CDC *pdc=GetDC();
    CBrush brush;
    brush.CreatePatternBrush(&m_bitmap);
    pdc->FillRect(rect,&brush);
    // Do not call CFormView::OnPaint() for painting messages
    }