Otóż mam taki kodzik:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, regexpr, ExtCtrls, jpeg, ExtDlgs;
type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Button2: TButton;
Edit1: TEdit;
pic: TOpenPictureDialog;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var x,y: Integer;
R,G,B : integer;
a : string;
begin
if (X >image1.Width) then
x := 1 ;
if (y >image1.height) then
y := 1 ;
R :=0;
B := 0;
G:= 0;
R := RGB(canvas.Pixels[x,y], 0,0);
G := RGB(0, canvas.Pixels[x,y],0);
B := RGB(0,0, canvas.Pixels[x,y]);
while (x<image1.Width) and (y<=image1.Height) do
begin
R := RGB(canvas.Pixels[x,y],0,0);
G := RGB(R, canvas.Pixels[x,y],0);
B := RGB(R,G, canvas.Pixels[x,y]);
Canvas.Pixels[X+ 600, y] := RGB(R,g,B);
R :=0;
B := 0;
G:= 0;
x:=x+1;
if (x = image1.Width -2) then
begin
y:= y+1;
x:= 1;
end;
end;
end;
end.
Tylko że mi się robi czarno-białe