添加两个picture control,然后在OnPaint()中调用LoadLogo()两次,但为什么只能显示一个控件上的图片?》
void CrossImage(CImage &img)  //对像素进行转换
{
for(int i=0; i<img.GetWidth(); i++)
{
for(int j=0; j<img.GetHeight(); j++)
{
UCHAR *cr = (UCHAR*) img.GetPixelAddress(i,j);
cr[0] = cr[0]*cr[3] / 255;
cr[1] = cr[1]*cr[3] / 255;
cr[2] = cr[2]*cr[3] / 255;
}
}
}
void CTestImageDlg::LoadLogo(CString filePath,UINT nID)
{
// TODO: 在此添加控件通知处理程序代码
CImage image;
image.Load(filePath));
CrossImage(image); CRect rect;
int cx=image.GetWidth();
int cy=image.GetHeight();
        CWnd *pwnd=GetDlgItem(nID);
pwnd->GetWindowRect(&rect);
ScreenToClient(&rect);
pwnd->MoveWindow(rect.left,rect.top,cx,cy,TRUE);
pwnd->GetClientRect(&rect);
CDC *pDc=pwnd->GetDC();
image.Draw(pDc->m_hDC,rect);
ReleaseDC(pDc);
}