The problem wasn't related to offscreen/onscreen problems. The issue is that the Palm IIIc only has a 12 bit color palette (4096 colors) that it can display. You can specify 24 bit colors in a color table, but won't see the difference on many colors because the display only shows 4 bits (16 levels) per component instead of 8 (256 levels).
Eric http://www.sniderware.com On 4/25/02 2:48 AM, "Eric Snider" <[EMAIL PROTECTED]> wrote: > My goal is to draw a nice smooth gradient in an offscreen window and then > copy it into my onscreen window. > > Right now I calculate 24 colors for the gradient and then change the > window's palette with WinPalette. I put the colors in starting at offset > 232. Then I draw the gradient by using WinSetForeColor() with the > appropriate color indices, and I draw lines into the offscreen window. I > tested the line drawing code by using every index in the color table and > it's clear that that code works ok. But... > > Once I'm done drawing the gradient offscreen I copy it to the onscreen > window. The result is that I get a really banded version of the gradient, > with around 5 bands of color instead of the 24 that I'm expecting. It looks > to me as if the offscreen window and the onscreen window have different > palettes. I tested out changing other colors in the onscreen window's > palette and I am definitely able to change the palette. The other art in my > program comes out differently depending on what I change. > > The offscreen window doesn't have a palette. I tried calling WinPalette > while it was the current draw window and got this fatal error in POSE - > "Draw window has no palette." > > I'm not sure what's going wrong and haven't found much advice about palettes > online. Has anyone run into a similar problem or can you steer me in the > right direction? > > Eric > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
