degraef
asked on
reading bmp file from dll
When trying to load a picture (800x600.bmp) into an Image field, from a dll.
var
hLib : integer;
hRes : Thandle;
begin
hLib:=loadLibrary('e:\unpa ck\1\empir e.dll');
hREs := findREsource(hLib,'black', '800x600') ;
Image1.Picture.LoadFromFil e(string(h Res));
end;
this gives me an error message saying picture with invalid extension. However I think it is something else.
I made a simple dll, with a res file called black.res.
var
hLib : integer;
hRes : Thandle;
begin
hLib:=loadLibrary('e:\unpa
hREs := findREsource(hLib,'black',
Image1.Picture.LoadFromFil
end;
this gives me an error message saying picture with invalid extension. However I think it is something else.
I made a simple dll, with a res file called black.res.
Is this a Dll you wrote? or someone else?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
????
{name.dll} is dll file you want to read.
In your case it's LoadLibrary('e:\unpack\1\e mpire.dll' );
and LoadImage is just a function of Win32. (New - Windows95)
{name.dll} is dll file you want to read.
In your case it's LoadLibrary('e:\unpack\1\e
and LoadImage is just a function of Win32. (New - Windows95)
ASKER
nothing suggested here seems to work.
Here is the complete history.
created res file as follows; black.res 'black' '800x600.bmp'
put it in a dll ($R black.res) compiled the dll = empire.dll.
in mainform of program I have an Image1 component.
The Load.Image1.Picture
or Image1.Picture.LoadImage suggested did not work.
Here is the complete history.
created res file as follows; black.res 'black' '800x600.bmp'
put it in a dll ($R black.res) compiled the dll = empire.dll.
in mainform of program I have an Image1 component.
The Load.Image1.Picture
or Image1.Picture.LoadImage suggested did not work.
What are the errors?
Did you make your Res -file with the image editor of delphi?
Did you make your Res -file with the image editor of delphi?
ASKER
With Load.Image1.. I get 'Unknown command' as well as the LoadImage
I made the res with brcc32.exe
I made the res with brcc32.exe
Which version of Delphi are you working on?
What if you make the res with Image editor?
What if you make the res with Image editor?
ASKER
Delphi 3
Haven't tried the image editor yet
Haven't tried the image editor yet
DllHandle := LoadLibrary({name.dll});
And use this DllHandle with
Image1.Picture.LoadImage(D
800,600, (options);
Have fun,
c.u.
ZifNab;