PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

display external image

what's wrong? I cannot display external image file

this is working:
m_mapbuttons.CreateSurface(hInstance, IDR_BUTTONS, TEXT("PNG"));

but this is not:
m_mapbuttons.CreateSurface(TEXT("\\My Documents\\GapiTest\\buttons.jpg"));

both images are 24-bit colors
hmmm.. maybe this is a lame question

but I cannot find any demo or sample which used the external image files

documentation said simply to write the absolute path of file, nothing more

I read a few posts about problems with images, but there were problems with colors depth only

anybody help?
What's the return code from the CreateSurface call? That might help solve the problem. Are you trying this from the desktop PC, or directly on the ppc device?
hmmm... I tried it on desktop and on PPC too

I think the problem was:
I opened GapiDraw diplay under normal windowed application, together, and/but there I used another imgdecmp.h routine to open another image in the windowed main WM_DISPLAY message. And I'm afraid it was hold to use by the GapiDraw (althrough that another image was displayed correctly and I tried to close all opened resources and loops by the imgdecmp).

If I deleted the above, I got external image in GapiDraw display.

BTW: what is the best way to use GapiDraw together with normal windowed or dialog application?

I added GapiDraw that lines:
::ZeroMemory(&config;, sizeof(GDAPPCONFIG));
config.hInstance = hInst;
config.pAppTitle = TEXT("MAP");
config.dwWindowIcon = IDI_MAP;
config.dwDisplayMode = GDDISPMODE_NORMAL;
config.dwTargetFPS = 30;
CMyApplication myapp(config);
return myapp.Run();

right after normal (within BOOL InitInstance):
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);

and it is working fine.

but: I can only switch the focus between normal window and GapiDraw screen, and I cannot access GapiDraw from the base application/menu.
for example:
myapp.Minimize() //not work
CMyApplication::Run //not work too

any suggestions?