Autor Beitrag
muh-kuh
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30

Oma
XYZ
BeitragVerfasst: Mo 18.09.06 18:27 
Hallo!

Ich habe da ein kleines Problem:

Ich möchte ein Programm schreiben, dass von einer Stringlist (z.B. TMemo) in der in jeder Zeile eine Dateiname steht, diesen Dateinamen öffnent (in meinem Fall ein Bild) und sie dann Automatisch in einen Ordner speichert (in einem anderen Format). Wenn dass erledigt ist, soll es den nächsten String bearbeiten und den nächsten, usw.

Wenn ein String leer ist, soll es die arbeit beenden.

Bitte helft mir.
Danke im Vorraus


Moderiert von user profile iconChristian S.: Topic aus Off Topic verschoben am Mo 18.09.2006 um 19:28
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 18.09.06 18:30 
Ja machen wir gerne, wenn du uns verräts, wo genau dein Problem liegt. Oder was hast du jetzt erwartet? :P

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
muh-kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30

Oma
XYZ
BeitragVerfasst: Mo 18.09.06 18:32 
ich weiß nicht wie das geht :D
sp992
Hält's aus hier
Beiträge: 13

Win Xp, Mac OSX, Linux
Delphi 7 Enterprise
BeitragVerfasst: Mo 18.09.06 18:34 
also wie man die strings ausließt weiß ich.
Das habe ich gerade geschrieben.
nehme ein stringgrid und nen timer dazu
dann erstelle eine integer variable und eine string variable z.b. pos: Integer; z.b. ABC: String; nun schreibst du in den timer
ausblenden Delphi-Quelltext
1:
2:
3:
stringgrid1.cols[0].loadfromfile('deine datei.txt');
ABC := stringgrid1.cells[0, pos];
pos := pos + 1;

ist allerdings etwas speicher fressend
mit der umwandlund das weiß ichj nicht wie das geht


Zuletzt bearbeitet von sp992 am Mo 18.09.06 18:37, insgesamt 1-mal bearbeitet
muh-kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30

Oma
XYZ
BeitragVerfasst: Mo 18.09.06 18:38 
1. Danke für die Hilfe, werds ausprobieren

2. Wie war das nochmal mit den Doppelposts

3. Wenn ich nicht weiß wie das geht hilft Grips ansträngen auch nicht!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mo 18.09.06 18:44 
Hallo!

Ich habe ein paar Postings gelöscht. Ich bitte darum, beim Thema zu bleiben und vor allem freundlich miteinander umzugehen.

Grüße
Christian

//edit: Ich hab mal einen Teil meiner Aussage hervor gehoben :roll:

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 18.09.06 18:49 
Du könntest sie in einer Zählschleife nach und nach in ein TImage laden und dann die Konvertierungsprozedur drauf anwenden und eben mit SaveToFile in einem neuen Ordner abspeichern. Wo liegt nun genau das Problem?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
muh-kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30

Oma
XYZ
BeitragVerfasst: Mo 18.09.06 18:54 
da is sogar ein neues Aufgetaucht. Ich hab die GraphEx Lib installiert und jetzt geht das noch viel weniger wie vorher :(
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 18.09.06 18:56 
user profile iconmuh-kuh hat folgendes geschrieben:
da is sogar ein neues Aufgetaucht. Ich hab die GraphEx Lib installiert und jetzt geht das noch viel weniger wie vorher :(

Welches Format haben die Originalbilder? Welches Format soll nachher rauskommen? Vielleicht braucht man die Library gar nicht? Was genau geht 'viel weniger wie vorher'? Du müsstest mal konkreter werden...

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
sp992
Hält's aus hier
Beiträge: 13

Win Xp, Mac OSX, Linux
Delphi 7 Enterprise
BeitragVerfasst: Mo 18.09.06 19:13 
schreib doch einfach noch unten in den timer
image1.picture.loadfromfile(ABC) dann musst du nur noch den speicherbefehl dran hängen
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 18.09.06 19:17 
user profile iconsp992 hat folgendes geschrieben:
schreib doch einfach noch unten in den timer
image1.picture.loadfromfile(ABC) dann musst du nur noch den speicherbefehl dran hängen

Warum einen Timer verwenden? Eine Zählschleife tuts doch auch, oder was?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
sp992
Hält's aus hier
Beiträge: 13

Win Xp, Mac OSX, Linux
Delphi 7 Enterprise
BeitragVerfasst: Mo 18.09.06 19:18 
ka mit dem timer hats bei mir immer am besten funktioniert
muh-kuh Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 30

Oma
XYZ
BeitragVerfasst: Mo 18.09.06 19:18 
Das soll ein Umwandler zwischen den formaten werden
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 18.09.06 19:20 
user profile iconmuh-kuh hat folgendes geschrieben:
Das soll ein Umwandler zwischen den formaten werden

Ach echt? :shock: :mrgreen: Du hast meine Frage(n) aber nicht beantwortet.

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
sp992
Hält's aus hier
Beiträge: 13

Win Xp, Mac OSX, Linux
Delphi 7 Enterprise
BeitragVerfasst: Mo 18.09.06 19:23 
also ich verwende den timer weil das einfach ist.... um den timer bei einem leeren feld zu beenden kann man ja einfach noch dran hängen if abc = '' then begin timer1.enabled := false;

was ist eine zählschleife? :oops:

ach ja du lädst die bilder einfach ins timage und speicherst diese danach einfach in nem anderen format... ka wie das geht aber ich g´laube dsa ist acuh nicht das thema
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Mo 18.09.06 20:14 
Ich würde es irgendwie so machen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.BatchUmwandeln;
var
  i: Integer;
  BMP: TBitmap;
begin
  BMP := TBitmap.Create;
  for i := 0 to Memo1.Lines.Count - 1 do
  begin
    //Das ist doch überflüssig irgendwie, oder?
    if Memo1.Lines[i] = '' then
      break;
    BMP.LoadFromFile(Memo1.Lines[i]);
    //Hier musst du dann das BMP in das gewünschte Format umwandeln
  end;
  BMP.Free;
end;
sp992
Hält's aus hier
Beiträge: 13

Win Xp, Mac OSX, Linux
Delphi 7 Enterprise
BeitragVerfasst: Mo 18.09.06 20:31 
user profile iconChryzler hat folgendes geschrieben:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  BMP := TBitmap.Create;
  for i := 0 to Memo1.Lines.Count - 1 do
  begin
    //Das ist doch überflüssig irgendwie, oder? 
    if Memo1.Lines[i] = '' then -wie kommst du auf memo1.lines[i]?
      break;
    BMP.LoadFromFile(Memo1.Lines[i]);
    //Hier musst du dann das BMP in das gewünschte Format umwandeln
  end;
  BMP.Free;
end;


warum machst dus so kompiliziert ich schreibe noch einmal meinen vorschlag komplett zusammenhängend:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.Timer1Timer(Sender: TObject);
var
Filename : String;
pos: Integer
begin
if filename = '' then begin
timer1.enabled:= false;
end
else

stringgrid1.cols[0].loadfromfile('filelist.txt');
Filename := stringgrid1.cells[0, pos];
pos := pos +1;
image1.picture.loadfromfile(Filename);
//Hier muss die umwandelung in ein anderes format rein vllt. image1.picture.savetofile(''); oda so

end;
end;
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 19.09.06 12:51 
user profile iconChryzler hat folgendes geschrieben:
Ich würde es irgendwie so machen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
procedure TForm1.BatchUmwandeln;
var
  i: Integer;
  BMP: TBitmap;
begin
  BMP := TBitmap.Create;
  for i := 0 to Memo1.Lines.Count - 1 do
  begin
    //Das ist doch überflüssig irgendwie, oder?
    if Memo1.Lines[i] = '' then
      break;
    BMP.LoadFromFile(Memo1.Lines[i]);
    //Hier musst du dann das BMP in das gewünschte Format umwandeln
  end;
  BMP.Free;
end;

Das ist vollkommen in Ordnung so. :zustimm:

user profile iconsp992 hat folgendes geschrieben:

warum machst dus so kompiliziert ich schreibe noch einmal meinen vorschlag komplett zusammenhängend:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure TForm1.Timer1Timer(Sender: TObject);
var

Filename : String;
pos: Integer
begin
if filename = '' then begin
timer1.enabled:= false;
end
else

stringgrid1.cols[0].loadfromfile('filelist.txt');
Filename := stringgrid1.cells[0, pos];
pos := pos +1;
image1.picture.loadfromfile(Filename);
//Hier muss die umwandelung in ein anderes format rein vllt. image1.picture.savetofile(''); oda so

end;
end;

Warum ein Stringgrid, wenn es auch mit TMemo oder TStringlist geht? Und warum mit einem Timer? :shock:
Ich könnte jetzt ja was abfälliges sagen, aber naja... :!:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot