Greetings,
I'm working with 8bit bitmap to display old game graphics (sprite, background, ecc.) on a TImage; simple GDI, no DirectX.
The TransparentBlt function work very well with transparency, but only when the transparent color is 0 (the first index of palette array).

[pascal]TransparentBlt(Image1.Canvas.Handle, x, y, Bitmap.Width, Bitmap.Height,
Bitmap.Canvas.Handle, 0, 0, Bitmap.Width, Bitmap.Height,
0);[/pascal]
work well with an 8bit bitmap which have the 0 index color transparent, for any other color (for ex. 255), do not work, it will display the transparent color as solid.
Any suggestion? Can be a bug of TransparentBlt? Am I wrong with something?

Meanwhile, I've created an "old-style" routine (I come from the old DOS Pascal 13h gfx world):

[pascal]Var SrcLine, DstLine: PByteArray;

Image1.Picture.Bitmap.PixelFormat := pf8bit;
Image1.Picture.Bitmap.Palette := CopyPalette(Bitmap.Palette);
for i := 0 to Bitmap.Height - 1 do
begin
SrcLine := Bitmap.ScanLine[i];
DstLine := Image1.Picture.Bitmap.ScanLine[i];
for j := 0 to Bitmap.Width - 1 do
begin
pixel_color := SrcLine[j];
if pixel_color <> 255 then
DstLine[j] := pixel_color;
end; //for j
end; //for i[/pascal]
Not so faster, but work (and for eliminate flicker, I can use a back buffer bitmap).
Any speed-up suggestion? Asm?