This programm starts well on my Tower with Windows 7:
Now the Code:
For i:=1 to 999 do
begin
case length(inttostr(i)) of
3: Pfad:= inttostr(i);
2: Pfad:='0'+inttostr(i);
1: Pfad:='00'+inttostr(i);
end;
Gesamterpfad:=(Zielordner+pfad+Dateityp);
if fileexists(gesamterpfad) then
begin
application.processmessages;
Anfangswert:=0;
inc(Anz_Bilder);
image2.Picture.loadfromfile(Gesamterpfad);
Bildfarbe:=true;
For Zeile:=0 to Y-1 do //Zeile is on german Row
begin
application.processmessages;
For Spalte:=0 to X-1 do //Spalte is column
begin
// x:=image1.Width;
// y:=image1.height;
// AT FIRST IT WORKS FIN BUT IF SPALTE:=1 THEN I GET ERROR MESSAGE
// INVALID HORIZONTAL PIXEL INDEX 1
application.processmessages;
Farbe1:=image1.canvas.pixels[Spalte,Zeile]; // farbe means COLOR in this point
Farbe2:=image2.canvas.pixels[Spalte,Zeile];
if farbe1<>farbe2 then
begin
// showmessage(inttostr(Zeile));
// showmessage(inttostr(spalte));
Bildfarbe:=false;
application.processmessages;
if Anfangswert=0 then
begin
x0:=Spalte;
y0:=Zeile;
max_alte_spalte:=spalte;
min_alte_spalte:=Spalte;
y_min:=y0;
y_max:=y0;
x_min:=x0;
x_max:=x0;
Anfangswert:=1;
end;
// showmessage(inttostr(spalte)+ ' ' + inttostr(alte_spalte));
if Spalte>max_alte_spalte then
begin
max_alte_Spalte:=spalte;
x_max:=Spalte;
end;
//showmessage(inttostr(spalte)+ ' ' + inttostr(min_alte_spalte));
if Spalte<min_alte_spalte then
begin
min_alte_Spalte:=spalte;
x_min:=min_alte_Spalte;
end;
if Zeile>y0 then
begin
y_max:=Zeile;
end;
if Zeile<y0 then
begin
y_min:=Zeile;
end;
end;
end;
end;
if Bildfarbe=false then
begin
//die Fehlerecke kennzeichnen
image2.canvas.Pen.color:=colorbox1.Selected;
image2.canvas.moveto(x_min-1,y_min-1);
image2.canvas.lineto(x_max+1,y_min-1); //+1 und -1 um die
image2.canvas.lineto(x_max+1,y_max+1); //Pixelfehler nicht
image2.canvas.lineto(x_min-1,y_max+1); //zu überstreichen!
image2.canvas.lineto(x_min-1,y_min-1);
Image2.Picture.SaveToFile(Falsche_Bilder_Ordner+pfad+dateityp);
memo1.Lines.add(Pfad);
end;
end;
end;
Here is the downloadlink:
http://www.file-upload.net/download-6935695/Aufgabe_4.rar.html