Hi all,
I am new to develop an AP on winCE 5.0 and I try to use the
IImage library. Now I can load the JPG picture on the screen
successfully and try to rotate it. However I met some problem.
I had find some suggestion which indicate how to rotate bitmap step by
step as follows:
CoInitialize
CoCreate CLSID_ImagingFactory
CreateImageFromFile which returns you an IImage interface
Query the IImage interface for IBasicBitmapOps interface
use the IBasicBitmapOps interface to adjust brightness, contrast,
gamma,
rotation, etc.
Use the IImage interface to Draw the bitmap on the screen
I just can't understand which does the "Query the IImage interface for
IBasicBitmapOps interface" means.
Here is my code and would anyone tell me where is going wrong ?
By the way, is it possible to use the IImage library to convert from
JPG to BMP and PNG ?
Thanks in advance, any suggestion will be appreciated.
::CoUninitialize();
IImagingFactory *pFactory = NULL;
IImage *pImage = NULL;
ImageInfo *info = NULL;
IBitmapImage *rotebitmap = NULL;
IBasicBitmapOps *oper = NULL;
::CoCreateInstance(CLSID_ImagingFactory,
NULL,CLSCTX_INPROC_SERVER,IID_IImagingFactory, (void **)&pFactory);
pFactory->CreateImageFromFile(L"\\jupiter.jpg", &pImage);
pFactory->CreateBitmapFromImage(pImage, 0, 0, PixelFormatDontCare,
InterpolationHintDefault, &rotebitmap);
pImage->QueryInterface(IID_IBasicBitmapOps, (void **) &oper);
oper->Rotate(180.0, InterpolationHintDefault, &rotebitmap);
pImage->Draw(hdc, &test , NULL);