MFC 打开Jpg文件
UpdateWindow(); int height, width; CRect rect;//定义矩形类 CRect rect1; CImage image; //创建图片类 image.Load(_T("1.jpg")); height = image.GetHeight(); width = image.GetWidth(); m_ctrlPic.GetClientRect(&rect); //获得pictrue控件所在的矩形区域 CDC *pDc = m_ctrlPic.GetDC();//获得pictrue控件的Dc SetStretchBltMode(pDc->m_hDC,STRETCH_HALFTONE); image.StretchBlt(pDc->m_hDC,rect,SRCCOPY); ReleaseDC(pDc);//释放picture控件的Dc