?
Solved

Resource files and Metafiles

Posted on 2000-05-07
12
Medium Priority
?
288 Views
Last Modified: 2010-05-18
I need to compile several metafiles (*.emf) into a resource file and then load them into a TPicture from within Delphi. How do I do it? presumably I use brcc32.exe to compile the .res, but what formats do I have to use, and how to I get TPicture.Metafile to load from the resource?

  Cheers, Steven
0
Comment
Question by:StevenB
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 2787344
I'm no expert in these things. But here you'll find some tips about resource files in general:

http://www.bhnet.com.br/~simonet/

Regards, Madshi.
0
 
LVL 15

Expert Comment

by:simonet
ID: 2787370
Hello, Steven

Can you send me a couple EMF files so I can build a demo application for you?

simonet@bhnet.com.br

Alex
0
 
LVL 15

Expert Comment

by:simonet
ID: 2787372
simonet changed the proposed answer to a comment
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 27

Accepted Solution

by:
kretzschmar earned 2000 total points
ID: 2787389
hi stevenB

a sample

creating a resource like

EMF1 METAFILE "MS.EMF"
(Name Typ Filename)
(saved as EMFRES.RC)

compile it with brcc32
add it to your unit

{$R *.DFM}
{$R EMFRES.RES}

use this sample code for display

procedure TForm1.Button1Click(Sender: TObject);
var RStream : TResourceStream;
begin
  RStream :=TResourceStream.Create(HInstance,'EMF1','METAFILE');
  try
    image1.Picture.Metafile.LoadFromStream(RStream);
  finally
    RStream.Free;
  end;
end;

meikl
0
 
LVL 4

Author Comment

by:StevenB
ID: 2787404
Sent them,

  did they arrive?
0
 
LVL 4

Author Comment

by:StevenB
ID: 2787432
Thanks meikl,

  works perfectly, Sometimes the solution is painfully simple. Cheers for the quick response everybody. Simonet, if you spend time working on an example for me before finding that the questions closed, then post a comment and I'll throw you some points. I'm loaded with 'em anyway :o)

  Steven
0
 
LVL 15

Expert Comment

by:simonet
ID: 2787442
Steve,

I just sent you the Zipped demo to you, via e-mail, with full source code.

The actual code that I sent you was taken from Resource Explorer, which is available from my site (Madshi gave you the address).

Yours,

Alex
0
 
LVL 15

Expert Comment

by:simonet
ID: 2787444
Meikl.. Grrrrrr.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2787494
oops, alex,
don't annoy you at me :-(

steven,
glad to helped you,
thanks for for accepting
my comment as an answer.

guessing that alex sended sample shows
more explaination about how to do.

good luck again

meikl
0
 
LVL 15

Expert Comment

by:simonet
ID: 2787502
>don't annoy you at me :-(

What????
Sometimes I don't know why I even bother...
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2787522
? seems that the babelfish-translator from altavista mixed something, therefore next try in free words

alex, don't be angry about me

meikl ;-)
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question