 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Johnnix Guest
|
Posted: Fri Apr 16, 2004 11:55 am Post subject: wmf inside an application |
|
|
Hello everybody,
Using a TImageList my app can have access to bitmaps that r stored
internaly. Is there a way to do so with wmf files?
Thank you very much for your time
|
|
| Back to top |
|
 |
Mike Shkolnik Guest
|
Posted: Fri Apr 16, 2004 1:34 pm Post subject: Re: wmf inside an application |
|
|
Not. TImageList work with bitmaps only.
But you may easy convert your wmf to bmp and from bmp to wmf
--
With best regards, Mike Shkolnik
EMail: [email]mshkolnik (AT) scalabium (DOT) com[/email]
http://www.scalabium.com
"Johnnix" <ioannides (AT) edrash (DOT) gr> wrote
| Quote: | Hello everybody,
Using a TImageList my app can have access to bitmaps that r stored
internaly. Is there a way to do so with wmf files?
Thank you very much for your time
|
|
|
| Back to top |
|
 |
Nils Haeck Guest
|
Posted: Sat Apr 17, 2004 10:32 pm Post subject: Re: wmf inside an application |
|
|
| Quote: | But you may easy convert your wmf to bmp and from bmp to wmf
|
From bmp to wmf is not possible. At least, not losslessly and if you are
able to in the first place, it is very difficult.
Nils
"Mike Shkolnik" <mshkolnik2002 (AT) ukr (DOT) net> wrote
| Quote: | Not. TImageList work with bitmaps only.
But you may easy convert your wmf to bmp and from bmp to wmf
|
|
|
| Back to top |
|
 |
Mat Ballard Guest
|
Posted: Sun Apr 18, 2004 11:47 pm Post subject: Re: wmf inside an application |
|
|
Johnnix wrote:
| Quote: | Using a TImageList my app can have access to bitmaps that r stored
internaly. Is there a way to do so with wmf files?
|
yes - incorporate the WMF _file_ into your application as a resource, then load
the resource as a stream.
eg: you have a file called MyFile.wmf.
create a files called images.rc; it contains:
MyFile WMF "MyFile.wmf"
compile images.rc to images.res using brcc32.exe.
in your Delphi app:
{$R images.res}
....
// you will need to check exact syntax - this is off the top of my head:
Res:= TResourceStream.Create(hInstance, 'MyFile');
Res.Position := 0;
MyMetaFile.LoadFromStream(Res);
cheers,
Mat
|
|
| Back to top |
|
 |
Mat Ballard Guest
|
Posted: Mon Apr 19, 2004 11:25 pm Post subject: Re: wmf inside an application |
|
|
g'day Johnnix,
re:
| Quote: | I tried it according to your instruction and I get an EResNotFound
("Resource MyFIle not found") exception when the following line is executed:
Res:= TResourceStream.Create(hInstance, MyFile' ,RT_RCDATA);
|
{$DEFINE DEBUG ON}
now you need to debug, though not exactly in the traditional way.
first, check that MyFile _IS_ a resource within your application.
next, check the spelling, and the capitalization (i doubt that MyFIle is present).
third, if all else fails, then define MyFile as a resource number in your .rc
file, and use the TResourceStream.CreateID constructor.
cheers,
Mat
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|