Autor Beitrag
91KEY8
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 105


Delphi 3
BeitragVerfasst: Fr 06.10.06 19:32 
Ich möchte ein Bild aus einer DLL in ein Image laden. Leider geht es nicht!

Soviel hab ich schon und nun weiß ich leider nicht mehr weiter, denn das Image will das BMP nicht akzeptieren (image1.Picture.Bitmap(Bmp);)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
var
  Bmp: TBitmap;
  HandleDLL: THandle;
begin
  HandleDLL := LoadLibrary('res.dll');
  if HandleDLL = 0 then
  ShowMessage('res.dll nicht gefunden...')
else
try
  Bmp := TBitmap.Create;
try
  Bmp.Handle := LoadBitmap(HandleDLL, 'Bitmap1');
if Bmp.Handle = 0 then
  ShowMessage('Bild kann nicht geladen werden...')
else
// hier mag image Bmp nicht
  image1.Picture.Bitmap(Bmp);
finally
  Bmp.Free;
end;
finally
  FreeLibrary(HandleDLL);
end;
end;


mfg 91KEY8

Bitte helft mir!
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Fr 06.10.06 21:51 
Moin!

Probier das mal so:
ausblenden Delphi-Quelltext
1:
Image1.Picture.Bitmap.Assign(Bmp);					

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.