Board index » delphi » Lost Color Depth loading ImageList from File
Andy Bell
Delphi Developer |
Andy Bell
Delphi Developer |
Lost Color Depth loading ImageList from File2003-08-28 10:05:40 AM delphi164 Hi, I am loading ImageLists from individual BMP files using MyImageList.FileLoad( rtBitMap, 'AImageName', cMaskColor ); When I select these into my Toolbar I note that the color depth of the images has changed to 4 bit from 8 or 24bit. My 256 color bitmaps look terrible at this lower color depth. I cannot see any way to preserve the color depth of the original bitmaps. The problem does not exist if I load the bitmap files into the ImageList at design time Image List Editor. Does anyone have any suggestions? Regards Andy Bell |
Maynard Philbrook
Delphi Developer |
2003-08-28 01:35:23 PM
Re:Lost Color Depth loading ImageList from File
if the list is empty and the first image you place in there happens to be a
4 bit image then the initial image will be created as a 4 bit and all added images will be converted to 4 bit since the single master image was created as a 4 bit. that is my analogy of it.. :)) Andy Bell writes: QuoteHi, |
Danny Thorpe
Delphi Developer |
2003-08-29 01:50:51 AM
Re:Lost Color Depth loading ImageList from File
Andy,
The Microsoft ImageList control does not support color palettes. 16 color images generally work ok because most 16 color icons use the standard EGA color palette, so when ImageList ignores the color palette nothing terrible happens. To load a 256 color image into an imagelist, you should load the bitmap into a TBitmap first, change it is color depth to 24 bit (to eliminate the palette) then assign or draw the bitmap into the imagelist. Also, be sure you set the color depth of the ImageList before loading images into it. Images are coerced into to the ImageList pixel format as they are loaded, not the other way around. -Danny |
Andy Bell
Delphi Developer |
2003-08-29 04:38:00 AM
Re:Lost Color Depth loading ImageList from File
Thanks Danny - I will try this.
Did you write "Delphi Component Design"? I am still referring to this book - Have you written any others? Regards Andy |
Danny Thorpe
Delphi Developer |
2003-08-29 08:10:20 AM
Re:Lost Color Depth loading ImageList from File
"Andy Bell" <XXXX@XXXXX.COM>writes
QuoteThanks Danny - I will try this. -Danny |