I have some code for converting a color bitmap to 8-bit grayscale bitmap (GrayBmp: TBitmap) which includes the following:
My question is about freeing the palette after I finish with GrayBmp.
Do I need to separately do a DeleteObj(GrayBmp.Palette) before GrayBmp.Free or does GrayBmp.Free take care of it?
Bob
Code:
var
GrayPalette: TMaxLogPalette;
begin
GrayBmp.PixelFormat := pf8Bit;
SetGray256Palette(GrayPalette); // Set palette colors
GrayBmp.Palette := CreatePalette(PLogPalette(@GrayPalette)^);
Do I need to separately do a DeleteObj(GrayBmp.Palette) before GrayBmp.Free or does GrayBmp.Free take care of it?
Bob