Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2007.01.21;
Скачать: CL | DM;

Вниз

монохром   Найти похожие ветки 

 
Тиммммм   (2007-01-05 16:34) [0]

народ может кто знает как из цветной картинки сделать черно-белую,спасибо


 
Desdechado ©   (2007-01-05 16:37) [1]

каждый пиксел с цветом больше энного сделать черным, меньше энного - белым


 
antonn ©   (2007-01-05 16:41) [2]

procedure PrepareBitmap(_B_out:Tbitmap);
const  MaxPixelCount = MaxInt div SizeOf(TRGBTriple);
type  PRGBArray = ^TRGBArray;
TRGBArray = array[0..MaxPixelCount-1] of TRGBTriple;
var x, y: Integer; RowOut: PRGBArray;
begin
_B_out.PixelFormat:=pf24bit;
for y:=0 to _B_out.Height-1 do begin
   RowOut:= _B_out.ScanLine[y];
  for x:=0 to _B_out.Width-1 do begin
        RowOut[x].rgbtRed:=round(RowOut[x].rgbtRed*0.30+RowOut[x].rgbtGreen*0.59+RowOut[x].rgbtBlue*0.11);
        RowOut[x].rgbtGreen:=RowOut[x].rgbtRed;
        RowOut[x].rgbtBlue:=RowOut[x].rgbtRed;
  end;
end
end;


 
antonn ©   (2007-01-05 16:46) [3]

если нужно сделать порог цвета (что сомневаюсь):
Lr,Lg,Lb:byte - пороговые значения для каналов красного, зеленого, синего
procedure PrepareBitmapLevel(_B_out:Tbitmap; Lr,Lg,Lb:byte);
const Pixels = MaxInt div SizeOf(TRGBTriple);
type PRGBArray = ^TRGBArray;
    TRGBArray = array[0..Pixels-1] of TRGBTriple;
var x, y: Integer; RowOut: PRGBArray;
begin
 _B_out.PixelFormat:=pf24bit;
 for y:=0 to _B_out.Height-1 do begin
    RowOut:= _B_out.ScanLine[y];
   for x:=0 to _B_out.Width-1 do begin
      if (RowOut[x].rgbtRed>Lr)and(RowOut[x].rgbtGreen>Lg)and(RowOut[x].rgbtBlue>Lb) then begin
         RowOut[x].rgbtRed:=255;
         RowOut[x].rgbtGreen:=255;
         RowOut[x].rgbtBlue:=255;
      end else begin
         RowOut[x].rgbtRed:=0;
         RowOut[x].rgbtGreen:=0;
         RowOut[x].rgbtBlue:=0;
      end;
   end;
 end
end;


 
Тиммммм   (2007-01-05 16:47) [4]

спасибо выручили



Страницы: 1 вся ветка

Текущий архив: 2007.01.21;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.036 c
6-1156377385
dexer
2006-08-24 03:56
2007.01.21
Как передать файл, от ServerSockets к ClientSockets


6-1155850398
Victor!
2006-08-18 01:33
2007.01.21
Проблемма с TIdTCPClient.ReadLn в Delphi 7


5-1147098886
Dstr
2006-05-08 18:34
2007.01.21
RichWiev


15-1167639254
kaZaNoVa
2007-01-01 11:14
2007.01.21
Стресс и методы борьбы с ним


6-1155930238
Rescator
2006-08-18 23:43
2007.01.21
Клиент веб-чата на делфи. Как реализовать?