x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Colours on Jornada 720... A cautionary tale of wasted effort

chiark Page Icon Posted 2004-09-24 6:18 AM
#
Avatar image of chiark
H/PC Sensei

Posts:
1,330
Location:
North of England
Status:
I am porting an application to WinCE, and part of the application displays simple graphics (static pictures) with a very limited colour palette - 16 colours!

I've been building this on the emulator, and all looks good. However, when I build for the HPC2000, a picture's colours look utterly different - far too bright!

I assumed this was down to me getting something wrong with my CreateDIBSection calls, so tried manually writing to a display device compatible bitmap using SetPixel, then comparing the colour that SetPixel actually allocated against what I asked for. The results? SetPixel got what it wanted, and still the picture looked completely different. Of course, this was after trying all sorts of things to check that the colour palette that I wanted was loaded (which is unnecessary as DIBs are supposed to abstract all that away from the developer!)

Quite amazed, I was running out of ideas and inspiration. Out of despiration, I took a screengrab of the picture on the emulator, pasted it into Paint, and saved the resulting bitmap.

On opening that bitmap on the HPC, yes, you've guessed it, the colours look wrong and are exactly the same as my application displays! This same bitmap looks very different on the emulator.

ARRRGGHHHHHHHHHHHHHHHH!!!!!

So I've wasted a fair bit of time thinking my code is wrong, when in fact it is the display technology of the 720 which is causing the disparity.

The moral of the tale? Try the bleedin' obvious first to ensure that it's not the machine. After that, try creatively re-writing your routines!

Still, I've learned a lot about device contexts, palettes, and device dependent vs device independent bitmaps

Spleen vent over, I feel much better now

Cheers,
Nick,
 Top of the page
Jump to forum:
Seconds to generate: 0.140 - Cached queries : 59 - Executed queries : 8