15,979
社区成员
发帖
与我相关
我的任务
分享
void CDlg_Main::OnPaint()
{
CPaintDC dc(this);
CDC *pDC;
pDC = ((CStatic*)GetDlgItem(IDC_STATIC_top))->GetDC();
CRect rect;
GetDlgItem(IDC_STATIC_top)->GetWindowRect(&rect);
Graphics graphics(pDC->m_hDC); // Create a GDI+ graphics object
graphics.DrawImage(m_pImage, 0, 0, rect.Width(), rect.Height());
}
void CDlg_Child1::OnPaint()
{
CPaintDC dc(this); // device context for painting
CDC *pDC;
pDC = ((CStatic*)GetDlgItem(IDC_STATIC_PIC))->GetDC();
CRect rect;
GetDlgItem(IDC_STATIC_PIC)->GetWindowRect(&rect);
Graphics graphics(pDC->m_hDC); // Create a GDI+ graphics object
graphics.DrawImage(m_pImage, 0, 0, rect.Width(), rect.Height());
}
bool CDlg_Main::ShowDlgPage(int nPage)
{
HideAllDlg();//这个是先把所以对话框隐藏掉
switch (nPage)
{
case 0:
m_pDlg_Child1->ShowWindow(SW_NORMAL);
break;
case 1://显示第一页
m_pDlg_Child2->ShowWindow(SW_NORMAL);
break;
case 2:……//同上
default://默认显示第一页
m_pDlg_Child1->ShowWindow(SW_NORMAL);
break;
}
UpdateWindow();
return true;
}
BOOL CDlg_Wizard::OnInitDialog()
{
CDC *pDC;
pDC = ((CStatic*)GetDlgItem(IDC_STATIC_top))->GetDC();
CRect rect;
GetDlgItem(IDC_STATIC_top)->GetWindowRect(&rect);
Graphics graphics(pDC->m_hDC); // Create a GDI+ graphics object
graphics.DrawImage(m_pImage, 0, 0, rect.Width(), rect.Height());
}