wince 加载bmp文件方法
一、方法一SHLoadDIBitmap
bool LoadBitmapFile(LPCTSTR szFIleName,CDC& dc)
CDC memdc;
memdc.CreateCompatibleDC(&dc);
CBitmap bmBkgnd, *pOldBitmap = NULL;
HBITMAP bitmap=NULL;
bmBkgnd.Detach();
bitmap = (HBITMAP)::SHLoadDIBitmap(szFIleName);
if(bitmap!=NULL)
{
bmBkgnd.Attach(bitmap);
pOldBitmap = memdc.SelectObject(&bmBkgnd);
dc.BitBlt(0,0,800,480,&memdc,0,0,SRCCOPY);
memdc.SelectObject(&pOldBitmap);
bmBkgnd.DeleteObject();
memdc.DeleteDC();
return true;
}
return false;
}
二、方法二使用Imaging技术
此方法可加载JPG PNG GIF BMP等
void CTestSaveJPGDlg::ShowPic(const TCHAR *fileName)
{
IImage * m_pImage, *m_p