L
lance2000
Unregistered / Unconfirmed
GUEST, unregistred user!
//反色,即:底片效果
procedure NotColor(SrcBmp:Tbitmap);
var
i, j: integer;
SrcRow: pRGBArray;
ScanlineBytes:integer;
begin
ScanlineBytes:=SrcBmp.Width*3;
SrcRow := SrcBmp.ScanLine[0];
for i := 0 to SrcBmp.Height - 1 do
begin
for j := 0 to SrcBmp.Width - 1 do
begin
SrcRow[j].rgbtRed :=not SrcRow[j].rgbtRed ;
SrcRow[j].rgbtGreen :=not SrcRow[j].rgbtGreen;
SrcRow[j].rgbtBlue :=not SrcRow[j].rgbtBlue;
end;
dec(integer(SrcRow), ScanlineBytes); //老外写的是inc!!!
end;
end;
那个老外是Tjpegimage的作者.偶不太懂何时用inc何时用dec,与dib有关?
与os有关?与bmp有关?
procedure NotColor(SrcBmp:Tbitmap);
var
i, j: integer;
SrcRow: pRGBArray;
ScanlineBytes:integer;
begin
ScanlineBytes:=SrcBmp.Width*3;
SrcRow := SrcBmp.ScanLine[0];
for i := 0 to SrcBmp.Height - 1 do
begin
for j := 0 to SrcBmp.Width - 1 do
begin
SrcRow[j].rgbtRed :=not SrcRow[j].rgbtRed ;
SrcRow[j].rgbtGreen :=not SrcRow[j].rgbtGreen;
SrcRow[j].rgbtBlue :=not SrcRow[j].rgbtBlue;
end;
dec(integer(SrcRow), ScanlineBytes); //老外写的是inc!!!
end;
end;
那个老外是Tjpegimage的作者.偶不太懂何时用inc何时用dec,与dib有关?
与os有关?与bmp有关?