Hi, I have a Clie SJ20 which supports HiRes 16 grayscale. However, the default 
HiRes mode is B&W. One needs to explicitly set the screen depth to 4 in order 
to get HiRes 16 grayscale. I hope the following code from Vexed source can  
help:


Err    err;
UInt16 cBpp;
UInt32 dwVer;
UInt32 dwDepth = 0;

UInt32 dwDepthsSupported = 0;
static Int16 gaBpps[] = { 0 /*24*/, 0 /* 16 */, 8, 4, 2, 1 };
Int8   n;

FtrGet(sysFtrCreator, sysFtrNumROMVersion, &dwVer);
if (dwVer < 0x03003000) {
        cBpp = 1;
        return cBpp;
}

// Get the depths supported
WinScreenMode(winScreenModeGetSupportedDepths, NULL, NULL, &dwDepthsSupported, 
NULL);

// Set the highest depth possible

cBpp = 1;
for (n = 0; n < 6; n++) {
        if (dwDepthsSupported & (1UL << (gaBpps[n] - 1))) {
                WinScreenMode(winScreenModeGet, NULL, NULL, &dwDepth, NULL);
                if (dwDepth != gaBpps[n]) {
                        dwDepth = gaBpps[n];
                        err = WinScreenMode(winScreenModeSet, NULL, NULL, 
&dwDepth, NULL);
                        if (err == 0) {
                                        cBpp = (int)dwDepth;
                                        break;
                        }
                } else {
                        cBpp = (int)dwDepth;
                        break;
                }
        }
}


_______________________________________________
plucker-dev mailing list
[EMAIL PROTECTED]
http://lists.rubberchicken.org/mailman/listinfo/plucker-dev

Reply via email to