🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
8 messages
8 total messages Started by Ron Sawyer Sun, 13 Apr 2003 22:47
Metafile parsing
#16999
Author: Ron Sawyer
Date: Sun, 13 Apr 2003 22:47
5 lines
1047 bytes
I am looking for sample code to parse window's metafiles.  I need to
pull out each record to be able to convert it to another format.  Does
anyone know of a way to do this?

Thank
Re: Metafile parsing
#17001
Author: Remy Lebeau (TeamB)
Date: Sun, 13 Apr 2003 23:25
14 lines
1468 bytes
If you want to do raw parsing, then go to http://www.wotsit.org to download
the specs for both the EMF and WMF formats.

Otherwise, you might consider having a look at the VCL's TMetaFile class.
You can Assign() it to other TGraphic decendants, such as TBitmap.


Gambit

"Ron Sawyer" <rsawyer8128@aol.com> wrote in message
news:3E99E8E7.9023C1E0@aol.com...
> I am looking for sample code to parse window's metafiles.  I
> need to pull out each record to be able to convert it to
> another format.  Does anyone know of a way to do this?
Re: Metafile parsing
#17004
Author: Adam Versteegen
Date: Sun, 13 Apr 2003 23:56
23 lines
1527 bytes
Ron Sawyer wrote:

> I am looking for sample code to parse window's metafiles.  I need to
> pull out each record to be able to convert it to another format.  Does
> anyone know of a way to do this?


Hello Ron,

Take a loot at:

http://www.efg2.com/Lab/Library/Delphi/Graphics/FreddyDarsonvilleMetafileRot
ation.TXT

Its in delphi and shows a method (or the start of) for rotating metafiles.
In order to properly rotate them you need to enumerate each of the records,
so you will see how to do what you need.

The main function you will need to come to terms with is EnumEnhMetaFile().

Let us know if you have any problems.

Vesty.
Re: Metafile parsing
#17005
Author: Ron Sawyer
Date: Sun, 13 Apr 2003 23:58
15 lines
1204 bytes
An excellent suggestion Vesty.thanks!  I should have checked EFG's site
first.  Thanks for the timely reminder.

Adam Versteegen wrote:
> 
> 
> Hello Ron,
> 
> Take a loot at:
> 
> http://www.efg2.com/Lab/Library/Delphi/Graphics/FreddyDarsonvilleMetafileRot
> ation.TXT
> 
>
> Vesty.
Re: Metafile parsing
#17003
Author: Ron Sawyer
Date: Sun, 13 Apr 2003 23:59
18 lines
1618 bytes
Thanks Gambit.  I know about TMetaFile, but have to do raw parsing.  I
look at the specs.

"Remy Lebeau (TeamB)" wrote:
> 
> If you want to do raw parsing, then go to http://www.wotsit.org to download
> the specs for both the EMF and WMF formats.
> 
> Otherwise, you might consider having a look at the VCL's TMetaFile class.
> You can Assign() it to other TGraphic decendants, such as TBitmap.
> 
> Gambit
> 
> "Ron Sawyer" <rsawyer8128@aol.com> wrote in message
> news:3E99E8E7.9023C1E0@aol.com...
> > I am looking for sample code to parse window's metafiles.  I
> > need to pull out each record to be able to convert it to
> > another format.  Does anyone know of a way to do this?
Re: Metafile parsing
#16944
Author: Joe C. Hecht
Date: Wed, 16 Apr 2003 02:57
47 lines
2399 bytes
We tried using EnumEnhMetaFile (and the non-enhanced version) for a simple
metafile that would lock up 95/98 and ME machines. Turned out the even loading
the metafile (without eenumerating) using Windows functions would result in severe
memory leaks.

We feel it is best to read the file raw, and enumerate them yourself (although the docs are
often incomplete or totally incorrect).

Joe


Delphi, graphics, and printing specialist available - $35/hr
http://www.code4sale.com/codeit/index.htm


----- Original Message -----
From: "Adam Versteegen" <no@email.com>
Newsgroups: borland.public.cppbuilder.nativeapi
Sent: Sunday, April 13, 2003 6:56 PM
Subject: Re: Metafile parsing


> Ron Sawyer wrote:
>
> > I am looking for sample code to parse window's metafiles.  I need to
> > pull out each record to be able to convert it to another format.  Does
> > anyone know of a way to do this?
>
>
> Hello Ron,
>
> Take a loot at:
>
> http://www.efg2.com/Lab/Library/Delphi/Graphics/FreddyDarsonvilleMetafileRot
> ation.TXT
>
> Its in delphi and shows a method (or the start of) for rotating metafiles.
> In order to properly rotate them you need to enumerate each of the records,
> so you will see how to do what you need.
>
> The main function you will need to come to terms with is EnumEnhMetaFile().
>
> Let us know if you have any problems.
>
> Vesty.
>
>
Re: Metafile parsing
#16945
Author: Adam Versteegen
Date: Wed, 16 Apr 2003 03:02
29 lines
2300 bytes
Joe C. Hecht wrote:

> We tried using EnumEnhMetaFile (and the non-enhanced version) for a simple
> metafile that would lock up 95/98 and ME machines. Turned out the even
loading
> the metafile (without eenumerating) using Windows functions would result
in severe
> memory leaks.
>
> We feel it is best to read the file raw, and enumerate them yourself
(although the docs are
> often incomplete or totally incorrect).
>
> Joe

I'd actually check the metafile you're using as opposed to the metafile
functions.... I've had no problems with the functions (and use them quite
heavily) provided that the metafiles i'm using are ok. Adobe Illustrator is
one application that produces bodgy files. Unless you get down to the nitty
gritty and make sure that it is freeing all it creates, if you try
repeatedly drawing these metafiles using any of the API calls you will
notice GDI resources vanishing before your eyes (which will lead to
lockups). I've found that metafiles that I create myself (using VCL
components) are fine and do follow all the proper rules.
If you do an enum on an illustrator file, you can see from the records it
spits out that they fail to clean up after themselves... Other programs may
do the same.

Vesty.
Re: Metafile parsing
#16970
Author: Joe C. Hecht
Date: Thu, 17 Apr 2003 21:03
46 lines
2980 bytes
Well, my report is based on several Microsoft articles
that accept responsibility for the bugs, working in the
Windows graphics industry since Windows verison 0.8 beta,
and supplying graphics engines to some of the top guns of
the desktop publishing graphics industry, and finally manning
the support lines at Borland for some time.

Of course, I could just be nuts<g>

Joe
--
Delphi, graphics, and printing specialist available - $35/hr
http://www.code4sale.com/codeit/index.htm

"Adam Versteegen" <no@email.com> wrote in message news:3e9cc7e0@newsgroups.borland.com...
> Joe C. Hecht wrote:
>
> > We tried using EnumEnhMetaFile (and the non-enhanced version) for a simple
> > metafile that would lock up 95/98 and ME machines. Turned out the even
> loading
> > the metafile (without eenumerating) using Windows functions would result
> in severe
> > memory leaks.
> >
> > We feel it is best to read the file raw, and enumerate them yourself
> (although the docs are
> > often incomplete or totally incorrect).
> >
> > Joe
>
> I'd actually check the metafile you're using as opposed to the metafile
> functions.... I've had no problems with the functions (and use them quite
> heavily) provided that the metafiles i'm using are ok. Adobe Illustrator is
> one application that produces bodgy files. Unless you get down to the nitty
> gritty and make sure that it is freeing all it creates, if you try
> repeatedly drawing these metafiles using any of the API calls you will
> notice GDI resources vanishing before your eyes (which will lead to
> lockups). I've found that metafiles that I create myself (using VCL
> components) are fine and do follow all the proper rules.
> If you do an enum on an illustrator file, you can see from the records it
> spits out that they fail to clean up after themselves... Other programs may
> do the same.
>
> Vesty.
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads