procedure TfrmMain.FadeBackBuffer2;
type TPixelArray =
packed array[0..0, 0..255]
of packed record
b, g, r: Byte;
end;
PPixelArray = ^TPixelArray;
var
dx: integer;
dy: integer;
i: integer;
begin
try
BitBlt(hTempDc, 0, 0, 256, nHeight,
DC, 256, 0, SRCCOPY);
//' Fade The Data.
for dy := 0
to nHeight - 1
do
begin
for dx := 0
to 255
do
begin
i := PPixelArray(pAddr)[dy, dx].b - 15;
if i < 0
then i := 0;
PPixelArray(pAddr)[dy, dx].b := i;
i := PPixelArray(pAddr)[dy, dx].g - 15;
if i < 0
then i := 0;
PPixelArray(pAddr)[dy, dx].g := i;
i := PPixelArray(pAddr)[dy, dx].r - 15;
if i < 0
then i := 0;
PPixelArray(pAddr)[dy, dx].r := i;
end;
end;
//' Blit The Faded Image To The Back Buffer.
BitBlt(
DC, 0, 0, 256, nHeight, hTempDc, 256, 0, SRCCOPY);
except
end;
end;