BOOL CXXXDlg::OnEraseBkgnd(CDC *pDC)
{
    CRect  rect;
    this->GetClientRect(rect);

    if(!m_pBkImage)                                                          //定义的一个成员变量
    {
        m_pBkImage = new Image(_T("main_frame.png"));
    }

    Bitmap bmp(rect.right, rect.bottom);

    Graphics bmpGraphics(&bmp);
    bmpGraphics.SetSmoothingMode(SmoothingModeAntiAlias);
    bmpGraphics.DrawImage(m_pBkImage, 0, 0, rect.Width(), rect.Height());    //Drawing on bitmap


    Graphics graphics(pDC->m_hDC);                                           //Drawing on DC

    CachedBitmap cachedBmp(&bmp,&graphics);
    graphics.DrawCachedBitmap(&cachedBmp, 0, m_iCaptionH);

    graphics.ReleaseHDC(pDC->m_hDC);

    return TRUE;
}

相关文章:

  • 2021-09-25
  • 2022-12-23
  • 2022-01-07
  • 2022-12-23
  • 2021-07-09
  • 2022-12-23
  • 2021-07-19
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-07
  • 2021-07-28
  • 2022-12-23
  • 2022-01-11
  • 2021-06-11
  • 2022-12-23
相关资源
相似解决方案