Solved

Resource files and Metafiles

Posted on 2000-05-07
12
276 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi TcxGrid group footer summary 3 211
Delphi application Soap connection 5 96
QRReport  TQrmemo vertical stretching 1 42
Firemonkey webbrowser scrollbars ? 1 29
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now