BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

wmf inside an application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Johnnix
Guest





PostPosted: Fri Apr 16, 2004 11:55 am    Post subject: wmf inside an application Reply with 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
Mike Shkolnik
Guest





PostPosted: Fri Apr 16, 2004 1:34 pm    Post subject: Re: wmf inside an application Reply with quote



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





PostPosted: Sat Apr 17, 2004 10:32 pm    Post subject: Re: wmf inside an application Reply with quote



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





PostPosted: Sun Apr 18, 2004 11:47 pm    Post subject: Re: wmf inside an application Reply with quote

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





PostPosted: Mon Apr 19, 2004 11:25 pm    Post subject: Re: wmf inside an application Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.