Before setting to 4-bit grayscale, you should check whether the device 
supports this mode.  If it only supports 1-bit (or 2-bit for that 
matter), it won't be able to do 4-bit.

That is, your tmpdepthP could be 0x00000001 (1-bit), 0x00000003 (2-bit), 
but not 0x000000B (4-bit).

Huy


 >   Date: Tue, 14 Aug 2001 21:21:35 -0700
 >   From: "Todd Walk" <[EMAIL PROTECTED]>
 >Subject: converting 8-bit color -> 4-bit gray problem
 >
 >I've got most of my app up and running in 8-bit color.
 >I've started to convert it to 4-bit grayscale.
 >
 >It compiles fine, but when I run it on the emulator with
 >devices that should have a 4-bit display, I get a 1-bit
 >output.
 >
 >Any ideas?
 >
 >I'm using the code below to try to force it into the correct mode.
 >(widthP, etc are globals.)
 >
 > UInt32 tmpdepthP;
 > Boolean tmpenableColorP;
 > 
 >WinScreenMode(winScreenModeGetSupportedDepths,NULL,NULL,&tmpdepthP,NULL);
 > >WinScreenMode(winScreenModeGet,&widthP,&heightP,&depthP,&enableColorP);
 > if(tmpdepthP>=128) //color
 > {
 >  tmpdepthP=8;
 >  tmpenableColorP=true;
 >  >WinScreenMode(winScreenModeSet,NULL,NULL,&tmpdepthP,&tmpenableColorP);
 > }
 > else //16 shade gray
 > {
 >  tmpdepthP=4;
 >  WinScreenMode(winScreenModeSet,NULL,NULL,&tmpdepthP,NULL);
 > }



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to