1,183
社区成员
发帖
与我相关
我的任务
分享
var
x, y: Integer;
p: PInteger;
bmp: TBitmap;
begin
bmp := TBitmap.Create;
bmp.LoadFromFile('你的图像.bmp');
bmp.PixelFormat := pf24bit;
for y := 0 to bmp.Height - 1 do
begin
p := bmp.ScanLine[y];
for x := 0 to bmp.Width - 1 do
if P^ and $FFFFFF = 0 then
P^ := P^ or $FFFFFF;
end;
bmp.SaveToFile('另存为图像.bmp');
bmp.Free;
end;
var
x, y: Integer;
p: PInteger;
bmp: TBitmap;
pixelFormat: TPixelFormat;
begin
bmp := TBitmap.Create;
bmp.LoadFromFile('你的图像.bmp');
pixelFormat := bmp.PixelFormat;
bmp.PixelFormat := pf32bit;
for y := 0 to bmp.Height - 1 do
begin
p := bmp.ScanLine[y];
for x := 0 to bmp.Width - 1 do
begin
if (P^ and $FFFFFF) = 0 then
P^ := P^ or $FFFFFF;
Inc(p);
end;
end;
bmp.PixelFormat := pixelFormat;
bmp.SaveToFile('另存为图像.bmp');
bmp.Free;
end;