Re: Need some help understanding get_pixel() results
- Posted by irvm at ellijay.com Jul 04, 2001
- 347 views
----- Original Message ----- From: <dstanger at belco.bc.ca> > Hello all, > > Some of you may have noticed my posts where I am working on scanning a > bitmap using get_pixel(). Well, I am using a solid blue bitmap as a test > subject and get_pixel() is returning color number 4 which is red, isn't it? Not necessarily. Color 4 can be just about any color you want it to be. Same applies to color 1,2, ....12... etc. The color number is just an index into the palette, which is an array of color values. Thinks of it as color[4] . Depending upon the graphics mode (2, 16, 256 colors, for example) the palette array will have more or less entries. Try looking at the palette sequence, and changing it. You'll see the colors cycle. A long time ago, I had a small program that would display all the colors DOS provides in a given mode, and let you modify them and save the new palette, to be used 'instead' of the palette which loads with the bitmap. You'll run into further problems with this also: if you try to use more than one bitmap on screen at one time, there's a good chance that loading the second bitmap will screw up the colors of the first (because you are over-writing the palette entries) You'll need to 'normalize' the palettes. A tool like PaintShop Pro can help here. If you need further info on that part, let me know. Regareds, Irv