Autor Beitrag
Marcasso
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 17



BeitragVerfasst: Di 30.01.07 22:22 
hallo, ich möchte, dass beim abspielen eines mp3 das albumcover geöffnet wird,
dies hab ich so geamcht, dass es vorher unter dem liednamen gespecihert wird,
das aufrufen sollte dann so erfolgen :
ausblenden Delphi-Quelltext
1:
form1.bild.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + '/bild/' + extractfilename(form2.ListA.Items.Strings[form2.listA.itemindex]));					

jedoch muss ich an dem string noch die letzten 4 stellen abschneiden, da das die endung .mp3 vom liednamen ist...
wie kann ich das realisieren?lg marc
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Di 30.01.07 22:40 
Schau Dir mal ChangeFileExt, ExtractFileExt das sollte Dir helfen.

Edit: Bin mal nicht so damit sparst Du Dir auch gleichzeitig das ersetzen der Endung.
ausblenden Delphi-Quelltext
1:
Form1.Bild.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + '\bild\' + ExtractfileName(ChangeFileExt(Form2.ListA.Items.Strings[Form2.ListA.ItemIndex],'.bmp'));					

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Roadrunner116
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Fr 02.02.07 20:23 
hi, hab dazu auch eine frage!
wie mache ich das, wenn ich ien Datum habe und die Jahreszahl abschneiden will?
da gibt es doch was, wo man den string auf lediglich 5 zeichen begrenzt oder?

Gruß Roadrunenr116
Raffo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 300



BeitragVerfasst: Fr 02.02.07 20:28 
Meinst Du sowas:
ausblenden Delphi-Quelltext
1:
2:
s:=strtodate(date);
s:=copy(s,1,5);
Roadrunner116
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 89

Win XP Home, Ubuntu Linux 6.06
Delphi 7, Java, PHP
BeitragVerfasst: Fr 02.02.07 20:31 
Danke!!! :wink:
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Fr 02.02.07 20:36 
Hallo,

oder:
ausblenden Delphi-Quelltext
1:
2:
3:
showmessage(FormatDateTime('dd.mm',StrToDate('02.02.2007')));
//oder das
showmessage(FormatDateTime('dd.mm',TDate(Now)));

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )