View Full Version : Standard WM DLL for displaying jpg, png, ...
DirectDance
06-06-2007, 01:59 PM
Hi,
While searching for a solution to display jpg pictures in a standard window, I have found the imaging.dll, a standard windows dll file since WM 2003.
That dll is for loading/displaying/manipulating not only bmp files but also jpg and png.
Examples found in the internet only describes c++ usage of the imaging dll file.
I tried the PPL command COMObjects an retrieved this (only a snippet):
imaging.Factory,imaging.dll
So, it is there on my PPC. But I can not use the commands ActiveX or CreateCOMObject to get access to it. Both are resulting in zero.
Has anybody used that dll in PPL and can give me some hints?
Thanks,
DirectDance
PointOfLight
06-06-2007, 04:33 PM
On your internet searches, have you found anything listing the functions that are present in the DLL?* If so, you could trying doing #declares on the functions you need and see if you can access the DLL that way.
DirectDance
06-08-2007, 06:53 AM
Source codes using that dll are very rare in the internet. I found this one, but I am not sure if this is convertable to PPL. The source code should load a picture:
HBITMAP LoadImageWithImagingApi(const CString &strFileName)
{
IImagingFactory *pImgFactory = NULL;
IImage *pImage = NULL;
CoInitializeEx(NULL, COINIT_MULTITHREADED);
HBITMAP hResult = 0;
if (SUCCEEDED(CoCreateInstance (CLSID_ImagingFactory,
NULL,
CLSCTX_INPROC_SERVER,
IID_IImagingFactory,
(void **)&pImgFactory)))
{
ImageInfo imageInfo;
if (SUCCEEDED(pImgFactory->CreateImageFromFile(strFileName, &pImage))
&& SUCCEEDED(pImage->GetImageInfo(&imageInfo)))
{
CWindowDC dc(0);
CDC dcBitmap;
dcBitmap.CreateCompatibleDC(&dc);
hResult = CreateCompatibleBitmap(dc.GetSafeHdc(), imageInfo.Width, imageInfo.Height);
if (hResult) {
HGDIOBJ hOldBitmap = dcBitmap.SelectObject(hResult);
pImage->Draw(dcBitmap.GetSafeHdc(), CRect(0, 0, imageInfo.Width, imageInfo.Height), NULL);
dcBitmap.SelectObject(hOldBitmap);
}
pImage->Release();
}
pImgFactory->Release();
}
CoUninitialize();
return hResult;
}
Thanks,
DirectDance
PointOfLight
06-08-2007, 02:26 PM
What are you using for the ClassID when you're calling CreateCOMObject?
DirectDance
06-11-2007, 09:35 AM
I tried to call it using
PicBoxActiveX$ = ActiveX(NULL, "imaging.Factory", 0, 0, 0, 0, NULL);
PicBoxAciveX$ is resulting in zero. So, no pinter was set. The position values (4 times zero) doesn´t matter. Changing them wont result in a pointer.
I got the name "imaging.Factory" from the ppl commands:
COMObjects(objects$, -1);
ausgabe$ = ("\ActiveX Objects:\n\n" + ListToStr(objects$, #13#10, "", "")+"\n");
SaveStr("\\Speicherkarte\\Programme\\PPL\\Projects \\comobjects.txt", ausgabe$, -1);
The result is (and many more of course):
imaging.Factory,imaging.dll
It is also displaying for example the line:
PocketOutlook.Application,pimstore.dll
Wich I can call like this with success:
poom$ = CreateCOMObject("PocketOutlook.Application");
Trying
PicBoxActiveX$ = CreateCOMObject("imaging.Factory");
will result in zero, too.
I think, this one is only accessable by using Visual C ...
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.