
07.08.2008, 11:08
|
Продвинутый
|
|
Регистрация: 13.02.2006
Адрес: Магнитогорск
Сообщения: 669
Репутация: 14745
|
|
Замена "серых" цветов на черный:
Код:
procedure replacecolor(p: integer); //ниже p - серый
var
x, y:integer;
r, g, b:byte;
begin
for y := 0 to image.height - 1 do
for x := 0 to image.width - 1 do begin
r := getRValue(Image.canvas.pixels[x, y]);
g := getGValue(Image.canvas.pixels[x, y]);
b := getBValue(Image.canvas.pixels[x, y]);
if (r = g) and (g = b) {and (b = r)} and (r < p) then Image.canvas.Pixels[x, y] := rgb(255, 255, 255);
end;
end;
|