I am trying to load JPG images using CImage under windows CE6. I have searched online but most of them use a function as described below (but the function itself is disabled for CE users):
CImage myImage;
myImage.Load(_T("C:\Image.jpg"));// Not available in windows CE
Because in atlimage.h:
#ifndef _WIN32_WCE
inline HRESULT CImage::Load( IStream* pStream ) throw()
{
if( !InitGDIPlus() )
{
return( E_FAIL );
}
Gdiplus::Bitmap bmSrc( pStream );
if( bmSrc.GetLastStatus() != Gdiplus::Ok )
{
return( E_FAIL );
}
return( CreateFromGdiplusBitmap( bmSrc ) );
}
inline HRESULT CImage::Load( LPCTSTR pszFileName ) throw()
{
if( !InitGDIPlus() )
{
return( E_FAIL );
}
Gdiplus::Bitmap bmSrc( (CT2W)pszFileName );
if( bmSrc.GetLastStatus() != Gdiplus::Ok )
{
return( E_FAIL );
}
return( CreateFromGdiplusBitmap( bmSrc ) );
}
Is there any other alternative method of loading jpg/bmp/gif/png files using CImage or anything else?