Autor Beitrag
Rool
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 19.01.03 14:45 
Ich hab eine Mini-Avi Sequenz in meinem Prog benutzt, und will sie als Ressource einbinden, damit sie nicht lose im Programmverzeichnis "rumfliegt". wie realisiere ich das :?:

_________________
MFG Rool
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 19.01.03 16:20 
1) Date anlegen: "Ressource.rc"

2) Mit Notepad öffnen:
ausblenden Quelltext
1:
Video RcData Video.avi					


3) Im Prompt eintippen:
ausblenden Quelltext
1:
C:\Programme\Delphi\Bi\Brcc32.exe C:\Projekte\Ressource.rc					

(Pfade/Dateinamen anpassen)

4) Du hast die RES-Datei. Kopiere sie in das Verzeichnis, in dem auch die DPR-Datei ist.

5) DPR öffnen, und ziemlich oben irgendwo eintippen:
ausblenden Quelltext
1:
{$R Ressource.res}					


6) Neu compilieren

PS: Bei mir ist das so, dass Delphi die DPR erst öffnen darf, nachdem Du die RES in's Verezcihnis kopiert hast.
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: So 19.01.03 19:07 
Titel: Noch ne Frage.... (einbinden)
OK, vielen dank schon mal, hab die resourcen-datei. Aber wie lade ich jetzt das video in meine TAnimate Komponente??

_________________
MFG Rool
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 19.01.03 19:19 
Zur Laufzeit über die Propertys ResName oder ResID (In deinem Fall ResName, wenn du einen Namen angegeben hast).
Tower
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 99



BeitragVerfasst: Mo 20.01.03 12:27 
Gibt es eigentlich irgendwo eine Übersicht darüber, was man alles in eine Resource-Datei packen kann und über die entsprechenden Schlüsselwörter? Die Delphi-Hilfe scheint mir da wenig auskunftsfreudig zu sein...
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Mo 20.01.03 13:27 
Titel: Alles...
hab inzwischen im netz gelesen, dass man ALLES in eine exe einbinden kann, solange man weis, wie man den Inhalt zu lesen hat! Also es gibt auch benutzerdefinierte Formate...

Man muss übrigens beim Avi einbinden noch das ResHandle von der Animate-Kompo auf hInstance sezten!

_________________
MFG Rool
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mo 20.01.03 19:46 
@Rool, Du hast recht. Man kann alles als "RcData" einbinden, dann kann man es als dynamischen Speicher laden.

Aber bestimmte Formate, z.B. Strings, bitmaps, Icons, usw. kann man im entsprechenden Format speichern und dann z.B. ein bitmap direkt als HBitmap laden, und nicht als dynamsichen Speicher.

Infos gibt's in der Win-Api-Hilfe (Widnwos Programmer's/Developers's Guide) unter den Begriffen z.B. "Stringtable Resource", "Bitmap Resource" etc.
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Di 21.01.03 13:55 
Titel: Korrekt
genauso ists. Und avis bindet man am besten gleich als AVI ein. Das Format ist nämlich ebenfalls bekannt!

_________________
MFG Rool
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Di 21.01.03 17:33 
Sorry, aber das ist falsch. Avi ist nicht bekannt. Du kannst zwar als Typ "Avi" angeben (z.B. "Video1 Avi Video1.avi"), aber das läuft dann als RcData. Probier's mal, du kannst jeden X-Beliebigen String als Typ angeben. Außerdem gibt's keine Spezifische Ladefunktion wie z.B. LoadBitmap(), also ist's RcData (Raw-Data). Folgende Daten sind bekannt:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
RT_ACCELERATOR  Accelerator table
RT_ANICURSOR  Animated cursor
RT_ANIICON  Animated icon
RT_BITMAP  Bitmap resource
RT_CURSOR  Hardware-dependent cursor resource
RT_DIALOG  Dialog box
RT_FONT  Font resource
RT_FONTDIR  Font directory resource
RT_GROUP_CURSOR  Hardware-independent cursor resource
RT_GROUP_ICON  Hardware-independent icon resource
RT_ICON  Hardware-dependent icon resource
RT_MENU  Menu resource
RT_MESSAGETABLE  Message-table entry
RT_RCDATA  Application-defined resource (raw data)
RT_STRING  String-table entry
RT_VERSION  Version resource

(Auszug aus der Online-Hilfe)
Rool Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 211



BeitragVerfasst: Di 21.01.03 19:05 
Titel: oh...
Oh, dann hab ich ma wohl vertan :nixweiss:
Nehm alles zurück...

_________________
MFG Rool
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Mi 22.01.03 17:53 
Na ja, jeder kann sich mal Irren. Aber unter uns: Ich binde AVIs auch immer als Avi ein, ich habe hier nur RcData angegeben, dass keine Muissverständnisse auftauchen. :roll:
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Sa 26.07.03 19:03 
Bin total am verzweifeln: Habe mir, wie oben beschrieben, eine avi in eine
Resourcen-datei geladen! Nur schaffe ich es beim besten willen nicht, diese auch zu laden! Habe es so probiert :AnimationAni.Play((PChar(2), hInstance ,1, 8, 0); abgeschaut von: PlaySound(PChar(3),HInstance, snd_ASync or snd_Memory or snd_Resource); Was mache ich falsch?

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: Sa 26.07.03 20:19 
Hallo,

zeig mal deine RC-Datei! Und compilier das Projekt neu, lösche zuvor alle DCUs/EXE, dann bist du sicher, dass die RES in der EXE ist. Denn evtl. spinnt Delphi mal wieder, das kommt mal vor.

_________________
Life is a bad adventure, but the graphic is really good!
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: Sa 26.07.03 21:22 
Alles andere futz ja, nur die blöde avi nicht Is denn der Aufruf richtig? Wie geschrieben, habe ich nur versucht, ihn von PlaySound abzuleiten. Stimmt der etwa? Wär mal was neues... :D :wink: :D ! Hier die file:
ausblenden Quelltext
1:
2:
3:
4:
1 ICON "H:\Delphi\Projects\Data\Main.ico"
2 RcData "H:\Delphi\Projects\Data\Search.avi"
3 WAVE "H:\Delphi\Projects\Data\Verzeichniss.wav"
4 WAVE "H:\Delphi\Projects\Data\Endung.wav"

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 27.07.03 06:49 
Also der Aufruf war schon mal gänzlich falsch, soviel habe ich rausgefunden :oops: Eigendlich geht er:
ausblenden Delphi-Quelltext
1:
2:
3:
AnimationAni.ResHandle := hInstance;
    AnimationAni.ResName := 'Search';
    AnimationAni.Play(1,4,0)


Nun stellt sich mir das nächste Problem:
Wenn mein Prog versucht, die AVI bei bedarf zu laden, erhalte ich das:
ausblenden Quelltext
1:
Im Projekt xxx.exe ist eine Exception der Klasse Exception.Meldung: 'AVI kann nciht geöffnet werden'. ...					


Ok, exception heißt in diesem Falle wohl Beanstandung oder Einwand! Hilft mir aber nich weiter! Aus dem CPU-Fenster werd ich auch nich so ganz schlau :?!?: Kennt die Meldung wer in dem Zusammenhang und weiß was das genau heißt? Glaube der findet die AVI nich in der .res, kann das? Hoffe auf baldige Hilfe :D

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 27.07.03 09:10 
AnimationAni.ResHandle := HInstance :wink:

_________________
Life is a bad adventure, but the graphic is really good!
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 27.07.03 16:34 
ausblenden Delphi-Quelltext
1:
AnimationAni.ResHandle := HInstance;					


Habe ich doch..
Oder ist genau das der Fehler?
Jetzt versth ich gar nichts mehr1

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Andreas Pfau
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 997



BeitragVerfasst: So 27.07.03 17:28 
:oops: hoppla, habe ich übersehen :oops:

Tipp: Irgendo im Demos-Ordner ist "Resexplor", damit öffnest du mal deine EXe, und guckst, ob die AVi auch tatsächlich gelinkt wurde.

_________________
Life is a bad adventure, but the graphic is really good!
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 27.07.03 22:03 
Mir schein, die is echt nicht in der res :?!?: Jedenfalls nicht unter den Namen, die ich ihr gegeben habe. Allerdings ist eine "1" unter RcData, könnte es sein das...werd ich jetzt mal austesten!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!
Cruiser23
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 191

WinXP
D7 Prof.
BeitragVerfasst: So 27.07.03 22:20 
Selber Fehler!

_________________
Du steckst immer in der Sch****, das einzige, was sich ändert, ist die Tiefe!