Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Enumerating EMFPlus metafile records

154 views
Skip to first unread message

Robert Grubbs

unread,
Sep 18, 2002, 10:29:58 AM9/18/02
to
In the old Win32 API in wingdi.h, all of the WMF and EMF record
structures are defined. Thats fine for normal EMF/WMF, but newer
applications like Visio 2002 now export EMFPlusDual files. I've
checked all of the GDI+ headers defined in
vc7\PlatformSDK\Include\prerelease (and done a global search for a few
of the EMFPlus record enumeration values), and the EMFPlus records are
not defined anywhere. I need to be able to search text records for
custom tags we've defined (ie <DataString('CustomerName')>) and
replace the strings with actual data. We can do it on all of the
normal EMF/WMF records, plus we've figured out enough of the
DrawDriverString record to write in a string of the same length. We'd
really prefer, however, to have the real EMFPlus data structures.
Anyone know where I can get them?

On a related problem, does anyone know why the PlayRecordCallback
parameter to the EnumerateMetafile callback is always null?
Microsoft's own sample code for the Graphics.EnumerateMetafileProc
Delegate uses the PlayRecord to draw each metafile record; the sample
doesn't work, however. I presume this is related to the callbackData
parameter to Graphics.EnumerateMetafileProc; the documentation says to
pass in IntPtr.Zero, but I suspect that it should really recieve a
callback pointer. However, the PlayRecordCallback delegate doesn't
match Metafile.PlayRecord's signature (byte [] data instead of IntPtr
data). I'd really prefer the IntPtr form, since then I wouldn't have
to Marshal.Copy the data from the IntPtr data from the
EnumerateMetafileProc delegate into a byte [] array.

Any insight would be appriciated.

Thanks,
Robert W. Grubbs

John Hornick [MS]

unread,
Sep 20, 2002, 1:28:32 PM9/20/02
to
Hi,


The new EMF+ records are not currently documented. I am checking to
see if there exists any documentation which I can share with you.

If there is, I'll post something here. I expect that would be later
today or early next week.

I think your other question about the callback being null is more
related to System.Drawing and not the underlying GDI+, so it would
be best asked on the microsoft.public.dotnet.framework.drawing
newsgroup. I have experienced that behavior myself, but have not
yet had the bandwidth to solve it.

Thanks,
- John
Microsoft Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Visit http://www.microsoft.com/security for current information on security.

Mike Atkinson {reply address in .sig}

unread,
Sep 23, 2002, 4:38:16 AM9/23/02
to
In article <wrkK$rMYCHA.1336@cpmsftngxa07>, John Hornick [MS]
<JHor...@online.microsoft.com> ventured...

> your other question about the callback being null is more
> related to System.Drawing and not the underlying GDI+, so it would
> be best asked on the microsoft.public.dotnet.framework.drawing
> newsgroup. I have experienced that behavior myself, but have not
> yet had the bandwidth to solve it.

Me too - I posted such a question here about a month or so ago. There
are a couple of people here also interested in the answer (if there is
one!).

--
Dr. Michael Atkinson, GeoQuest Simulation Software Development
Note that email address in the headers is cleared monthly and NOT read.
Contact me at matkin...@LOCKabingdon.geoquest.slb.com
(firstly removing the CAPS LOCK).

Robert Grubbs

unread,
Sep 25, 2002, 3:16:20 PM9/25/02
to
Thanks for any help.

By the way, this is the microsoft.public.dotnet.framework.drawing
group I'm posting in, so I'm not sure what you meant.

While we're on the subject of metafiles, I've had other troubles:
1. With non-default scaling modes. Set a graphics surface to
PageUnit=GraphicsUnit.Inch, then DrawImage and DrawRectangle to the
same rectangle position on the surface. The metafile winds up smaller
than the rectangle it was drawn in.
2. Metafile.EmfHeader isn't public, yet Metafile.WmfHeader is. I'd
really like to get some of the EmfHeader data out without using
reflection to bypass the protection level.

Thanks,
Robert Grubbs

JHor...@online.microsoft.com (John Hornick [MS]) wrote in message news:<wrkK$rMYCHA.1336@cpmsftngxa07>...

Michael S. Scherotter

unread,
Dec 30, 2002, 2:29:23 AM12/30/02
to
Where is the documentation of the GDI+ metafile records?
Why is Microsoft withholding this valuable piece of the puzzle?
Michael S. Scherotter
www.charette.com

"John Hornick [MS]" <JHor...@online.microsoft.com> wrote in message
news:wrkK$rMYCHA.1336@cpmsftngxa07...

0 new messages