Discussion:
Easiest way to create metafiles?
(too old to reply)
David Thielen
2005-10-27 02:13:02 UTC
Permalink
Hi;

To test my code I need some metafiles. What is the easiest way to create them?
--
thanks - dave
Terry Fei[MSFT]
2005-10-27 07:58:06 UTC
Permalink
Hi Dave,
Welcome to NewsGroup!

A metafile consists of a sequence of 32-bit GDI commands.The fundamental
way to create an enhanced metafile is by recording a series of GDI
commands. Two GDI functions are provided to start and finish the recording
of an enhanced metafile.
HDC CreateEnhMetaFile(HDC hdcRef, LPCTSTR lpFileName,
CONST RECT * lpRect, LPCTSTR lpDescription);
HENHMETAFILE CloseEnhMetaFile(HDC hDC);

Function CreateEnhMetaFile creates a special device context, which will be
used to record an enhanced metafile. So CreateEnhMetaFile only sets the
stage for creating an enhanced metafile, in the same way BeginPath starts
the construction of a GDI path object. The first parameter, hdcRef, refers
to a reference device context, whose device information will be queried to
record the EMF. If NULL is passed as hdcRef, GDI uses the current display
device for reference. The second parameter, lpFileName, can be a disk file
name or a NULL pointer. If a valid file name is given, a file version of
the metafile is written to disk when construction is complete. If NULL is
given, a metafile is memory based.

The following article is about how to create an Enhanced Metafile and
including relevant sample code. I hope it's useful for you,
Title: Creating an Enhanced Metafile
URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/met
afile_13s5.asp

If you have any questions or concerns, please feel free to let me know.
Thanks! : )

Best Regards,

Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
David Thielen
2005-10-27 13:24:04 UTC
Permalink
Hi;

I tried PaintShopPro and it does it - piece of cake to create test files.
--
thanks - dave
Post by Terry Fei[MSFT]
Hi Dave,
Welcome to NewsGroup!
A metafile consists of a sequence of 32-bit GDI commands.The fundamental
way to create an enhanced metafile is by recording a series of GDI
commands. Two GDI functions are provided to start and finish the recording
of an enhanced metafile.
HDC CreateEnhMetaFile(HDC hdcRef, LPCTSTR lpFileName,
CONST RECT * lpRect, LPCTSTR lpDescription);
HENHMETAFILE CloseEnhMetaFile(HDC hDC);
Function CreateEnhMetaFile creates a special device context, which will be
used to record an enhanced metafile. So CreateEnhMetaFile only sets the
stage for creating an enhanced metafile, in the same way BeginPath starts
the construction of a GDI path object. The first parameter, hdcRef, refers
to a reference device context, whose device information will be queried to
record the EMF. If NULL is passed as hdcRef, GDI uses the current display
device for reference. The second parameter, lpFileName, can be a disk file
name or a NULL pointer. If a valid file name is given, a file version of
the metafile is written to disk when construction is complete. If NULL is
given, a metafile is memory based.
The following article is about how to create an Enhanced Metafile and
including relevant sample code. I hope it's useful for you,
Title: Creating an Enhanced Metafile
URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/met
afile_13s5.asp
If you have any questions or concerns, please feel free to let me know.
Thanks! : )
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
David Thielen
2005-10-27 15:20:08 UTC
Permalink
Sorry - wrong answer. PaintShopPro creates a metafile by just making a bitmap
of an image and making that the one item in the metafile
--
thanks - dave
Post by David Thielen
Hi;
I tried PaintShopPro and it does it - piece of cake to create test files.
--
thanks - dave
Post by Terry Fei[MSFT]
Hi Dave,
Welcome to NewsGroup!
A metafile consists of a sequence of 32-bit GDI commands.The fundamental
way to create an enhanced metafile is by recording a series of GDI
commands. Two GDI functions are provided to start and finish the recording
of an enhanced metafile.
HDC CreateEnhMetaFile(HDC hdcRef, LPCTSTR lpFileName,
CONST RECT * lpRect, LPCTSTR lpDescription);
HENHMETAFILE CloseEnhMetaFile(HDC hDC);
Function CreateEnhMetaFile creates a special device context, which will be
used to record an enhanced metafile. So CreateEnhMetaFile only sets the
stage for creating an enhanced metafile, in the same way BeginPath starts
the construction of a GDI path object. The first parameter, hdcRef, refers
to a reference device context, whose device information will be queried to
record the EMF. If NULL is passed as hdcRef, GDI uses the current display
device for reference. The second parameter, lpFileName, can be a disk file
name or a NULL pointer. If a valid file name is given, a file version of
the metafile is written to disk when construction is complete. If NULL is
given, a metafile is memory based.
The following article is about how to create an Enhanced Metafile and
including relevant sample code. I hope it's useful for you,
Title: Creating an Enhanced Metafile
URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/met
afile_13s5.asp
If you have any questions or concerns, please feel free to let me know.
Thanks! : )
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Vipin[MVP]
2005-10-27 22:33:14 UTC
Permalink
If you visit Microsoft office online, you can get wmfs for cliparts, if that
serves your purpose.
--
Vipin Aravind
MVP [Windows - Printing/Imaging]
Post by David Thielen
Sorry - wrong answer. PaintShopPro creates a metafile by just making a bitmap
of an image and making that the one item in the metafile
--
thanks - dave
Post by David Thielen
Hi;
I tried PaintShopPro and it does it - piece of cake to create test files.
--
thanks - dave
Post by Terry Fei[MSFT]
Hi Dave,
Welcome to NewsGroup!
A metafile consists of a sequence of 32-bit GDI commands.The fundamental
way to create an enhanced metafile is by recording a series of GDI
commands. Two GDI functions are provided to start and finish the recording
of an enhanced metafile.
HDC CreateEnhMetaFile(HDC hdcRef, LPCTSTR lpFileName,
CONST RECT * lpRect, LPCTSTR lpDescription);
HENHMETAFILE CloseEnhMetaFile(HDC hDC);
Function CreateEnhMetaFile creates a special device context, which will be
used to record an enhanced metafile. So CreateEnhMetaFile only sets the
stage for creating an enhanced metafile, in the same way BeginPath starts
the construction of a GDI path object. The first parameter, hdcRef, refers
to a reference device context, whose device information will be queried to
record the EMF. If NULL is passed as hdcRef, GDI uses the current display
device for reference. The second parameter, lpFileName, can be a disk file
name or a NULL pointer. If a valid file name is given, a file version of
the metafile is written to disk when construction is complete. If NULL is
given, a metafile is memory based.
The following article is about how to create an Enhanced Metafile and
including relevant sample code. I hope it's useful for you,
Title: Creating an Enhanced Metafile
URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/met
afile_13s5.asp
If you have any questions or concerns, please feel free to let me know.
Thanks! : )
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
David Thielen
2005-10-27 22:47:02 UTC
Permalink
Thank you for all of the help on my questions.
--
thanks - dave
Post by Vipin[MVP]
If you visit Microsoft office online, you can get wmfs for cliparts, if that
serves your purpose.
--
Vipin Aravind
MVP [Windows - Printing/Imaging]
Post by David Thielen
Sorry - wrong answer. PaintShopPro creates a metafile by just making a bitmap
of an image and making that the one item in the metafile
--
thanks - dave
Post by David Thielen
Hi;
I tried PaintShopPro and it does it - piece of cake to create test files.
--
thanks - dave
Post by Terry Fei[MSFT]
Hi Dave,
Welcome to NewsGroup!
A metafile consists of a sequence of 32-bit GDI commands.The fundamental
way to create an enhanced metafile is by recording a series of GDI
commands. Two GDI functions are provided to start and finish the recording
of an enhanced metafile.
HDC CreateEnhMetaFile(HDC hdcRef, LPCTSTR lpFileName,
CONST RECT * lpRect, LPCTSTR lpDescription);
HENHMETAFILE CloseEnhMetaFile(HDC hDC);
Function CreateEnhMetaFile creates a special device context, which will be
used to record an enhanced metafile. So CreateEnhMetaFile only sets the
stage for creating an enhanced metafile, in the same way BeginPath starts
the construction of a GDI path object. The first parameter, hdcRef, refers
to a reference device context, whose device information will be queried to
record the EMF. If NULL is passed as hdcRef, GDI uses the current display
device for reference. The second parameter, lpFileName, can be a disk file
name or a NULL pointer. If a valid file name is given, a file version of
the metafile is written to disk when construction is complete. If NULL is
given, a metafile is memory based.
The following article is about how to create an Enhanced Metafile and
including relevant sample code. I hope it's useful for you,
Title: Creating an Enhanced Metafile
URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/met
afile_13s5.asp
If you have any questions or concerns, please feel free to let me know.
Thanks! : )
Best Regards,
Terry Fei[MSFT]
Microsoft Community Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Continue reading on narkive:
Loading...