PDA

View Full Version : JPEG and the GameAPI


PointOfLight
11-05-2007, 02:34 PM
It would seem that I can no longer load JPEG images through the GameAPI.* The images I'm trying to work with are fairly simple, but just to be sure I wasn't doing anything wrong I tried some images from a program I wrote several itterations of PPL ago.* They worked fine back then, but don't now.

I have tried both the LoadSurface and LoadPackageFile / LoadSurfaceFromMem options, and neither will load a JPEG for me.

PointOfLight
11-05-2007, 03:58 PM
Okay, I can't believe that something so simple is eluding me, but I can't get this to work.* If I enter the following code:

surf$ = LoadSurface(AppPath$ + "images\\splash.bmp", -1);
DrawSurface(surf$, buffer%, 0, 0, 0, 0);

I get an access violation on DrawSurface.* I know the image exists, and it should be the type of BMP file that PocketHAL can handle (8 BPP, 72 DPI).* Now if I change the code to the following:

surf$ = LoadSurface(AppPath$ + "images\\splash.bmp", -1);
tmp$ = NewSurface(240, 320);
DrawSurface(surf$, tmp$, 0, 0, 0, 0);
DrawSurface(tmp$, buffer%, 0, 0, 0, 0);


I don't get an access violation error, but the image never displays on the screen either.* I have attached the BMP file that I'm using.

PointOfLight
11-05-2007, 04:01 PM
Let's try this again.* Here's the file. [br]1194282060_49_FT7625_splash2.zip

PointOfLight
11-05-2007, 04:34 PM
As it turns out, I just don't know what I'm doing, apparently.* The reason I was getting the Access Violation error was because I was drawing the surface outside of the WM_PAINT procedure.* My bad.* Sorry for wasting a whole thread just to work out my own issues.

Donone
11-05-2007, 04:52 PM
You have made me feel better believe it or not, I waste threads a great deal!! Maybe sometimes it is the typing of it that helps to find the solution.

kornalius
11-05-2007, 05:25 PM
Hehe, you scared me for a minute here Eric. Reading down the posts there was smile slowy coming up on my face, glad you found it.