一般放在重绘函数OnPaint()里

 OnPaint()

{

       //为按钮添加图片

        Image image(L"...resSH\\退出系统正常状态.png",TRUE);
        Graphics graphics(m_button16.GetWindowDC()->m_hDC);
        graphics.DrawImage(&image,0,0,image.GetWidth(),image.GetHeight());

         //为窗体添机背景图片

         CPaintDC dc(this); // device context for painting

         CRect rect;

         GetClientRect(&rect);
         Graphics graphics(dc.m_hDC);
         //加载PNG图片
         Bitmap background(L".\\userlist\\classlist_top.png");
         graphics.DrawImage(&background,0,0,rect.Width(),rect.Height());
         CDialog::OnPaint();

}

 

相关文章:

  • 2021-11-07
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
  • 2021-09-04
  • 2021-08-19
  • 2021-06-05
猜你喜欢
  • 2022-12-23
  • 2022-01-31
  • 2022-12-23
  • 2021-12-20
  • 2021-12-27
  • 2022-12-23
相关资源
相似解决方案