Board index » delphi » Changing colors in 8-bit bitmaps when in high color mode
Fred Hovey
![]() Delphi Developer |
Sat, 08 Dec 2001 03:00:00 GMT
Changing colors in 8-bit bitmaps when in high color mode
I am using D4 to draw large GIS map images (some as big as 4000 x 4000 pixels) on a high color device by converting the images to
bitmaps that I feed to a timage component. To reduce memory consumption I have been using only 8-bit bitmaps. I create the bitmap from raw data by using the bitmap's scanline property and a file map to the file containing the raw data. The data are scaled to byte values and then written to the bitmap's data. If I change the bitmap's palette the colors change on screen, but unfortunately, the bitmap's data values change as well. The only way I can get the bitmap to display the new palette properly is to recreate the bitmap. This process can be quite slow. Is there a way to maintain the palette indices of the bitmap and just change the colors that the palette indices refer to? Any advice or suggestions regarding the process would be much appreciated. Thanks, |