Autor Beitrag
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Do 02.11.06 16:29 
wie kann ich bilder zur laufzeit in eine Dll einbinden?? oder geht das gar nicht??

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Bernhard Geyer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 721
Erhaltene Danke: 3



BeitragVerfasst: Do 02.11.06 21:48 
Was meinst Du damit genau? Wenn du die in der DLL hinterlegen willst so mach das z.B. einfach als Resource.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Do 02.11.06 21:50 
Du braüchtset dazu ja einen Ressourcencompiler und einen Linker, den du mitliefern müsstest.

_________________
Markus Kinzler.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Do 02.11.06 23:44 
user profile iconmkinzler hat folgendes geschrieben:
Du braüchtset dazu ja einen Ressourcencompiler und einen Linker, den du mitliefern müsstest.


Ich sag mal: Nö.
:D

Es gibt da die Funktion UpdateResource. Such mal danach. Ich guck mal, irgendwo hatte ich mal was mit gemacht.
Hier:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
procedure BmpToRes(bmp:TBitmap;ResID:integer;FileName:string);
var hres:THandle;
    ms:TMemoryStream;
    hs:integer;

begin
  hs:= sizeof(TBitmapFileHeader);
  hres:= BeginUpdateResource(PChar(FileName), false);
  ms:= TMemoryStream.Create;
  try
    bmp.PixelFormat:= pf4bit;
    bmp.SaveToStream(ms);
    UpdateResource(hres,RT_BITMAP,MAKEINTRESOURCE(ResID),GetSystemDefaultLangID,
                   (PChar(ms.Memory)+hs), ms.Size-hs);
  finally
    EndUpdateResource(hres,false);
    ms.free;
  end;
end;


Bindet BMP als Ressource mit der ID ResID in FileName ein.
Irgendwas muss aber da dran komisch sein, die ist auskommentiert gewesen. Das kann aber damit zu tun haben, dass ich ein komisches Format hatte/wollte/haben musste. (Hatte es dann über ResourceHacker-Kommandozeilen-Aufrufe gelöst.)

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
elundril Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 03.11.06 16:29 
könnte mir irgendjemand vl. erklären wie der code funktioniert?? ich wills ja immerhin nicht nur kopieren sonden auch kapieren!

lg el

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.