给你段代码参考一下吧:
procedure TForm1.Button1Click(Sender: TObject);
var
x,y,i: integer;
BitMap : TBitMap;
ptr : PByteArray;
begin
BitMap := TBitMap.Create;
try
BitMap.LoadFromFile('lanmannt.bmp');
BitMap.PixelFormat := pf24bit;
for i := 0 to 255 do begin
for y := 0 to BitMap.Height - 1 do begin
ptr := BitMap.ScanLine[y];
for x := 0 to ((BitMap.Width * 3) - 1) do
if ptr[x] > 0 then ptr[x] := (ptr[x] - 1);
end;
Image1.Canvas.Draw(0,0,BitMap);
Application.ProcessMessages;
end;
finally
BitMap.free;
end;
end;