W
wzgss
Unregistered / Unconfirmed
GUEST, unregistred user!
我试验代码如下:
procedure Contrast(var Bmp: TBitmap; Amount: Integer);
// Amount: -255~255
var
X, Y: Integer;
I: Byte;
ColorTable: array[0..255] of TRGBColor;
pRGB: PRGBColor;
begin
for I := 0 to 126 do
begin
Y := (Abs(128 - I) * Amount) div 256;
ColorTable.r := GetRValue(Byte(I - Y));
ColorTable.g := GetGValue(Byte(I - Y));
ColorTable.b := GetBValue(Byte(I - Y));
end;
for I := 127 to 255 do
begin
Y := (Abs(128 - I) * Amount) div 256;
ColorTable.r := GetRValue(Byte(I + Y));
ColorTable.g := GetGValue(Byte(I + Y));
ColorTable.b := GetBValue(Byte(I + Y));
end;
for Y := 0 to Bmp.Height - 1 do
begin
pRGB := Bmp.ScanLine[Y];
for X := 0 to Bmp.Width - 1 do
begin
pRGB.R := ColorTable[pRGB.R].R;
pRGB.G := ColorTable[pRGB.G].G;
pRGB.B := ColorTable[pRGB.B].B;
Inc(pRGB);
end;
end;
end;
语句:pRGB.R := ColorTable[pRGB.R].R;这个就出错,高手回答。如果邮寄给我完整的调试好的程序,100分奉上。songshuang@163.com
procedure Contrast(var Bmp: TBitmap; Amount: Integer);
// Amount: -255~255
var
X, Y: Integer;
I: Byte;
ColorTable: array[0..255] of TRGBColor;
pRGB: PRGBColor;
begin
for I := 0 to 126 do
begin
Y := (Abs(128 - I) * Amount) div 256;
ColorTable.r := GetRValue(Byte(I - Y));
ColorTable.g := GetGValue(Byte(I - Y));
ColorTable.b := GetBValue(Byte(I - Y));
end;
for I := 127 to 255 do
begin
Y := (Abs(128 - I) * Amount) div 256;
ColorTable.r := GetRValue(Byte(I + Y));
ColorTable.g := GetGValue(Byte(I + Y));
ColorTable.b := GetBValue(Byte(I + Y));
end;
for Y := 0 to Bmp.Height - 1 do
begin
pRGB := Bmp.ScanLine[Y];
for X := 0 to Bmp.Width - 1 do
begin
pRGB.R := ColorTable[pRGB.R].R;
pRGB.G := ColorTable[pRGB.G].G;
pRGB.B := ColorTable[pRGB.B].B;
Inc(pRGB);
end;
end;
end;
语句:pRGB.R := ColorTable[pRGB.R].R;这个就出错,高手回答。如果邮寄给我完整的调试好的程序,100分奉上。songshuang@163.com