var
bkBmp: TBitmap;
bkPix: PRGBTriple;
bmpPix: PRGBTriple;
x, y: integer;
begin
bkbmp:=TBitMap.create;
try
bkBmp.Height:=bmp.Height;
bkbmp.Width:=bmp.Width;
bmp.PixelFormat:=pf24Bit;
bkBmp.PixelFormat:=pf24bit;
bkbmp.Canvas.CopyRect(Rect(0,0,bmp.Width,bmp.Height),SCanvas,Rect(Ax,Ay,Ax+bmp.Width,Ay+bmp.Height));
for y:=0 to bmp.Height-1 do
begin
bkPix:=bkBmp.ScanLine[y];
bmppix:=bmp.ScanLine[y];
for x:=0 to bmp.Width-1 do
begin
[blue] if Rgb(bmpPix^.rgbtRed, bmpPix^.rgbtGreen, bmpPix^.rgbtBlue)<>[/blue]TransColor then
begin
bkPix^.rgbtRed:=(bkPix^.rgbtRed*(255-Bvalue)+bmpPix^.rgbtRed * Bvalue) div 255;
bkPix^.rgbtGreen:=(bkPix^.rgbtGreen*(255-Bvalue)+bmpPix^.rgbtGreen * Bvalue) div 255;
bkPix^.rgbtBlue:=(bkPix^.rgbtBlue*(255-Bvalue)+bmpPix^.rgbtBlue * Bvalue) div 255;
end;
Inc(bkPix);
inc(bmpPix);
end;
end;
Scanvas.Draw(Ax,Ay,bkBmp);
finally
bkbmp.free;
end;
end;