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
Solved

Resource files and Metafiles

Posted on 2000-05-07
12
281 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
  • 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 500 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
 
LVL 4

Author Comment

by:StevenB
ID: 2790797
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
QRReport  TQrmemo vertical stretching 1 53
Dev Express grid collapse 2 45
Installshield for Embarcadero EX 10.1 Berlin 4 60
firemonkey Android Listview Sort items 7 51
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

829 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