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?
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.
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
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.
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.
Are you running out of memory when trying to load these images? Are you checking the return codes for out of memory errors?
tevicar:
Please send me one of the images that doesn't work and I will have a look at it.
/Johan
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