Autor Beitrag
mg4all
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 21:25 
Hi Leute !

Ich habe folgendes Problem:

Ich habe eine Resourcendatei erstellt in der 3 Bilder sind

alt_winkel_0 BMP "alt_winkel_0.bmp"
alt_winkel_1 BMP "alt_winkel_1.bmp"
alt_winkel_2 BMP "alt_winkel_2.bmp"

jetzt versuche ich diese bilder aufzurufen :

ausblenden Delphi-Quelltext
1:
form1.Image3.Picture.Bitmap.LoadFromResourceName(HInstance,'alt_winkel_' + inttostr(bildindex) + '.bmp');					


aber irgendwie haut das nicht hin. Wenn mir jemand helfen könnte wär ich dankbar.

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 21:47 
Hallo,

versuchs mal so:

ausblenden Quelltext
1:
2:
3:
alt_winkel_0 BITMAP "alt_winkel_0.bmp"
alt_winkel_1 BITMAP "alt_winkel_1.bmp"
alt_winkel_2 BITMAP "alt_winkel_2.bmp"


ausblenden Delphi-Quelltext
1:
form1.Image3.Picture.Bitmap.LoadFromResourceName(HInstance,'alt_winkel_' + inttostr(bildindex));					
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:24 
Danke aber das habe ich schon probiert. Dann kommt ein Error vom Brcc32.exe

(invalid bitmap vormat)


Zuletzt bearbeitet von mg4all am Mi 04.07.07 22:27, insgesamt 1-mal bearbeitet
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 22:27 
Welcher Error denn? Möglicherweise bist du nicht im richtigen Verzeichnis oder eine oder mehrere eingebundene Dateien fehlen oder Dateinamen sind falsch getippt...

Gruß
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:29 
meine Bitmaps haben 24 bit.

_________________
Wer nicht fragt hat schon verloren !!!
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 22:33 
und deswegen wird ne Fehlermeldung ausgegeben?
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:38 
Ja.

Erhalte jedesmal wenn ich die res Datei kompiliere den fehler "invalid bitmap format". Woran kann das liegen ?

_________________
Wer nicht fragt hat schon verloren !!!
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 22:39 
Keine Ahnung aber öffne die Dateien mal mit Paint, gehe dann auf "Speichern unter.." und überschreibe die alten Dateien.
Dann müsste es eigentlich funktionieren.

Gruß
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:42 
Welche Dateien meist du ? Meine Bitmapdateien oder die res datei ?

Die Bitmaps müssen in 24 bit bleiben da ich sie mit anderen Bildern vergleiche !

_________________
Wer nicht fragt hat schon verloren !!!
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 22:44 
Die Bitmaps natürlich.
Ich denke Paint speichert automatisch in 24Bit.

Gruß
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:50 
Hallo.

Habe es versucht aber klappt auch nicht. Irgend etwas scheint bei der kompilierung schief zu gehen.

_________________
Wer nicht fragt hat schon verloren !!!
Saubäär
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 376



BeitragVerfasst: Mi 04.07.07 22:52 
Hm merkwürdig..
Mir fällt so spontan auch nichts mehr ein. Vielleicht liegts an deiner Delphiversion ?

Viel Glück noch!

Gruß
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Mi 04.07.07 22:58 
Kann mir sonst jemand helfen ?

Scheint ein Problem mit der res Datei zu sein ! :?:

_________________
Wer nicht fragt hat schon verloren !!!
Ghostwalker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 17

Windows XP Prof.
Turbo Delphi 2006, Delphi 7 Prof.
BeitragVerfasst: Mi 04.07.07 23:41 
Nimm mal die _ aus den Resourcenamen raus und probiers. (Ist nur eine Vermutung).

_________________
Gruß Ghostwalker
Es gibt keine Probleme, nur noch nicht gefundenen Lösungen
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Do 05.07.07 00:00 
Danke für die Antwort, aber auch das funktioniert leider nicht. Kennt jemand ein Tutorial wie Resourcen erstellt werden ?
Vor allem mit Bitmaps !!!!

_________________
Wer nicht fragt hat schon verloren !!!
Luckie
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 05.07.07 00:03 
Und wenn du nur nummerische Ressourcennamen vergibst?
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Do 05.07.07 00:08 
Danke. Hab ich auch schon daran gedacht. Aber ich will später über eine schleife immer das bild über den Namen aufrufen. Das muss doch möglich sein ODER ? :?:

_________________
Wer nicht fragt hat schon verloren !!!
Ghostwalker
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 17

Windows XP Prof.
Turbo Delphi 2006, Delphi 7 Prof.
BeitragVerfasst: Do 05.07.07 05:32 
Echt seltsam...

Auf dieser Seite http://www.wilsonc.demon.co.uk/delphi.htm
findest du ein Programm Namens XN Resource Editor. Der kann dir auch gleich eine RES-Datei erzeugen, die du nur einbinden brauchst. Probier mal ob deine Bilder damit funktionieren.

_________________
Gruß Ghostwalker
Es gibt keine Probleme, nur noch nicht gefundenen Lösungen
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Do 05.07.07 13:23 
Bei Mir klappt Es siehe Anhang.
Einloggen, um Attachments anzusehen!
mg4all Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 62

WIN 7
Delphi 7 Enterprise
BeitragVerfasst: Do 05.07.07 19:52 
Erst mal Danke für eure Antworten. Habe es noch einmal probiert und auch dein Beispiel heruntergeladen. Ja dein Beispiel funktioniert. Aber immer wenn ich meine Bitmaps (bilder.rc) mit dem brcc32.exe kompilieren will bekomme ich die Fehlermeldung "Invalid Bitmap Format". Meine Bilder sind im 24 bzw. 32 bit format. Wo kann der Fehler liegen ?

_________________
Wer nicht fragt hat schon verloren !!!