All Forums
 Microsoft Windows CE
 eVC Application Development
 LoadImage() From File (VGX DirectX)
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Author Topic  

ccoats

18 Posts

Posted - 20 Jul 2006 :  16:31:48  Show Profile  Email Poster
I'm having a problem loading an image from a file. I'm using a VGX board, CE 4.20.14.

Apparently, LoadImage() does not work with loading images from files on CE. I've seen references to SHLoadImageFile, but my aygshell.h does not contain this (from the SDK downloaded on this website), so that's out.

What I'd really like to use is this code:

---------
HBITMAP bitmap = NULL;
HRESULT res;

res = CoInitializeEx(NULL, COINIT_MULTITHREADED);
if ((res == S_OK) || (res == S_FALSE)) {
IImagingFactory* factory=NULL;

if (CoCreateInstance(CLSID_ImagingFactory, NULL, CLSCTX_INPROC_SERVER, IID_IImagingFactory, (void**)&factory) == S_OK)
----------

This code compiles fine for the VGX 4.20.14 but CoCreateInstance always fails - it seems like CSLID_ImagingFactory is not registered, although if I try this on a PocketPC PDA, it works fine.

Any ideas? I need to be able to get an HBITMAP structure from a file (.bmp, .jpg, .gif, whatever - I'll take anything at this point) but I'm not having any luck. If I put an image file on the device, Internet Explorer can load it, so obviously there must be SOME sort of API for this.

Thanks.

ctacke

877 Posts

Posted - 20 Jul 2006 :  16:50:19  Show Profile  Email Poster
Look at the SHLoadDIBitmap API.
Go to Top of Page

akidder

1519 Posts

Posted - 21 Jul 2006 :  11:17:55  Show Profile  Email Poster
#VGX_DDraw

I'd like to also make sure that you're using the DirectDraw-enabled display driver on the VGX.

We have two versions of the driver on the board: one that supports the display rotation features of the SM501 and the other that works with DirectX (which does not know about the hardware rotation).

When using DirectDraw, enable display driver as follows:

[HKEY_LOCAL_MACHINE\System\GDI\Drivers]
"Display"="DDI_VGX.dll"


The driver that does not support DirectDraw is "DDI_VGXR.dll".

I think you are using a rotated display in your application (portrait display on landscape hardware). You'll need to use the regular GWES APIs to load bitmaps in your system.
Go to Top of Page
  Topic  
 Forum Locked
 Send Topic to a Friend
 Printer Friendly
Jump To:
Eurotech Support Forums © Eurotech Inc. Go To Top Of Page
This page was generated in 0.02 seconds. Snitz Forums 2000