Re:Getting RGB Values (8bit and 24bit)
Quote
Miles wrote:
> I'm using ScanLine to obtain the RGB values for a particular bitmap (see code
> below). It works fine for 24bit but if the bitmap is 8bit, I get incorrect
> RGB values...which I suspected but am not sure what modifications I need to
> make to the code to support both 8bit and 24bit.
You need an array of byte to access the 8 bit values of an 8bpp bitmap. The 8
bit value is not a color but an index into the palette table which contains the
actual color you are seeking.
If you don't want to mess with the palette, the set PixelFormat := pf24bit, and
Delphi will create an 24 bpp bitmap for you to play with.
--
Wayne Herbert
Manager, Computer Products
Key Maps, Inc.
1411 West Alabama
Houston, TX 77006
Vox: 713.522.7949
Fax: 713.521.3202
Email: wherb...@keymaps.com
"Everywhere I go, I'm asked if I think universities stifle writers. My opinion
is that they don't stifle enough of them."
Flannery O'Connor (1925-1964)