对话框中怎么通过GDI+显示JPG格式背景图片

对话框中如何通过GDI+显示JPG格式背景图片。
如题,JPG图片是以资源形式嵌入程序的,显示时最好能让对话框适应图片大小或让图片适应对话框大小。
------解决方案--------------------
仅做个参考吧:
// 重载OnEraseBkgnd函数,用于绘制背景图片
BOOL BCDialog::OnEraseBkgnd(CDC* pDC)
{
CRect rect;    
GetClientRect(&rect);

if (!memDC_.IsOK())
{ // 背景还没有绘制到内存DC中
// 将背景绘制到内存DC中
SIZE size = { rect.Width(), rect.Height() };
memDC_.Create(pDC->GetSafeHdc(), &size);

Graphics graphics(memDC_.GetDC());
Bitmap bmpBG(szPicPath);
graphics.DrawImage(&bmpBG, 0, 0, rect.Width(), rect.Height());
}

::BitBlt(pDC->GetSafeHdc(), 0, 0, rect.Width(), rect.Height(), 
memDC_.GetDC(), 0, 0, SRCCOPY);

return TRUE;
}

------解决方案--------------------
http://blog.csdn.net/xianglifighter/article/details/34840207这个就可以,把加载的地方改成加载资源就可以了,这个可以自动适应控件大小来显示
------解决方案--------------------
引用:
参考楼上两位的方法实现,但不知如何解决表态控件的透明化。

假设你的static控件ID为IDC_STATIC1: 
然后重载对话框的WM_CTLCOLOR消息: 

在OnCtlColor中添加如下代码: 
HBRUSH CYourDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 

HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); 

// TODO: Change any attributes of the DC here 
switch(pWnd->GetDlgCtrlID()) 

case IDC_STATIC1: 
pDC->SetBkMode(TRANSPARENT); 
pDC->SetTextColor(RGB(0,0,0)); 
return (HBRUSH)GetStockObject(HOLLOW_BRUSH); 
default: 
break; 


// TODO: Return a different brush if the default is not desired 
return hbr; 
}

------解决方案--------------------
引用:
参考楼上两位的方法实现,但不知如何解决表态控件的透明化。

直接DrawText好了,不要用静态控件