unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls, ExtDlgs; type TForm1 = class(TForm) Image1: TImage; OpenDialog1: TOpenDialog; OpenPictureDialog1: TOpenPictureDialog; GroupBox1: TGroupBox; Edit1: TEdit; Edit2: TEdit; Edit3: TEdit; Edit4: TEdit; GroupBox2: TGroupBox; Button1: TButton; Button3: TButton; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public xmax,ymax:integer; fajl:string; { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); Var x,y,yteto,yalj,maxx,maxy,maxr,ry,sy,r:integer; alapszin:Tcolor; {Ezen lehetne még javítani?} Function kore(x,ry,r:integer):boolean; Var ok:boolean; svy:integer; svx:integer; Begin svx:=0; ok:=true; While ok and (svx=xmax then Begin x:=0; inc(y); End; While (canvas.pixels[x,y]=alapszin) and (y<=Ymax) do Begin x:=x+1; If x>=xmax then Begin x:=0; inc(y); End; End; If y<=ymax then Begin yteto:=y; sy:=y; y:=y+1; While (canvas.pixels[x,y]<>alapszin) and (ymaxr then Begin if kore(x,ry,r) then Begin if maxr=ymax; if maxr>0 Then Begin korrajz(maxx,maxy,maxr,ClRed); ShowMessage('Megtaláltam!'); End Else ShowMessage('Nincs kör!'); END; procedure TForm1.Button2Click(Sender: TObject); begin if OpenPictureDialog1.Execute then Begin Fajl:=OpenPictureDialog1.Filename; Image1.Picture.LoadFromFile(Fajl); { xmax:=Image1.Picture.Width; ymax:=Image1.Picture.Height;} End; end; procedure TForm1.Button3Click(Sender: TObject); begin Form1.Close; end; end.