Register
Site Login
Site Search
Forums
Advertisement
Welcome to PocketMatrix. PocketMatrix is dedicated to providing the best online community for mobile device developers and enthusiests. What's new?

strange image loading behavior


strange image loading behavior

Postby thevicar » Aug 27, 2002 @ 9:42pm

Hello,

I'm getting very unpredictable results using CGapiSurface::CreateSurface() with a path/filename argument. basically, sometimes the image loads and sometimes it doesn't. I am calling it right after initializing the surface, could this be related? anyway I don't have the same problem using resources, the problem is it's much harder to swap things out and it's a drag downloading everything to the PDA every time I compile. has anyone else experienced this?
thevicar
pm Member
 
Posts: 5
Joined: Aug 19, 2002 @ 9:26pm


Postby DillRye » Aug 28, 2002 @ 1:43am

I honestly havent used the file loading features, but as for the "drag downloading" you can almost copy and paste your entire wince project into Visual C++(if you own it) and compile for stationary computers. I started to do this and I have nearly instant results. Every once in a while I will compile it to run on my PPC to make sure everything is ok.
User avatar
DillRye
pm Insider
 
Posts: 477
Joined: Apr 25, 2002 @ 7:28am
Location: Iowa State University of Eng


Postby efortier » Aug 28, 2002 @ 6:38pm

I'm only using CreateSurface() with filenames, and I never had a problem with it, be it for normal surfaces or fonts.

Here's the call I make in my main image loading loop (TSurface is just a CGapiSurface with a few new properties):

TSurface *S1 = new TSurface;
cRes = S1->CreateSurface(PathName);

Never fails. I suggest you look over your code.

--Eric
User avatar
efortier
pm Insider
 
Posts: 373
Joined: May 15, 2002 @ 10:32pm


Postby thevicar » Aug 28, 2002 @ 10:16pm

hi,

it turns out there is something wrong with some of my images - what, I'm not sure. they're 24-bit .bmp's. some load and work perfectly as they should, with the code I was using all along (which is like yours). some won't load but (!) if I repeat the CreateSurface call right away, then they sometimes load. so, I'm going to try resaving all the images using something other than Photoshop.
thevicar
pm Member
 
Posts: 5
Joined: Aug 19, 2002 @ 9:26pm


Postby thevicar » Aug 30, 2002 @ 11:28pm

I've experimented a little bit and I've found there is a correlation between an image's dimensions and whether it will load properly. Unfortunately I haven't been able to discern a pattern (ie height or width needs to be even, etc.), but I find certain sizes work and certain others don't, no matter what drawing program I save them in.
thevicar
pm Member
 
Posts: 5
Joined: Aug 19, 2002 @ 9:26pm


Postby Hosed » Aug 31, 2002 @ 12:36am

Are you running out of memory when trying to load these images? Are you checking the return codes for out of memory errors?
L. L. Goodwin<BR>Purveyor of Code<BR><A href="http://www.planettribes.com/hosed/">Hosed's House of Code</A>
User avatar
Hosed
pm Member
 
Posts: 249
Joined: Jan 3, 2002 @ 2:51am
Location: Montana, USA


Postby Johan » Aug 31, 2002 @ 8:51am

tevicar:

Please send me one of the images that doesn't work and I will have a look at it.

/Johan
Last edited by Johan on Sep 5, 2002 @ 8:55am, edited 1 time in total.
User avatar
Johan
pm Member
 
Posts: 1843
Joined: Jan 12, 2002 @ 12:38pm
Location: Sweden


Postby thevicar » Sep 5, 2002 @ 8:50am

hmm, this is really stupid but I was adding an offset point to the point I was blitting to, and had forgotten to initialize it. after fixing that, things now work normally but I have no idea why different images would react differently to that, and consistently, or why it worked at all. oh well, I'm new to c/c++ and gapidraw... sorry - peter
thevicar
pm Member
 
Posts: 5
Joined: Aug 19, 2002 @ 9:26pm


Return to GapiDraw


Sort


Forum Description

The Cross-platform Graphics SDK for Palms, Pocket PCs, Symbian Devices, and Stationary PCs.

Moderators:

sponge, Johan

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron