Skip to content

Latest commit

 

History

History
121 lines (78 loc) · 5.32 KB

nf-wingdi-createmetafilea.md

File metadata and controls

121 lines (78 loc) · 5.32 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:wingdi.CreateMetaFileA
CreateMetaFileA function (wingdi.h)
The CreateMetaFile function creates a device context for a Windows-format metafile. (ANSI)
CreateMetaFileA
wingdi/CreateMetaFileA
gdi\createmetafile.htm
gdi
81b3baae-f0e6-4b71-a6de-953ad3376dbd
12/05/2018
CreateMetaFile, CreateMetaFile function [Windows GDI], CreateMetaFileA, CreateMetaFileW, _win32_CreateMetaFile, gdi.createmetafile, wingdi/CreateMetaFile, wingdi/CreateMetaFileA, wingdi/CreateMetaFileW
wingdi.h
Windows.h
Windows
Windows 2000 Professional [desktop apps only]
Windows 2000 Server [desktop apps only]
CreateMetaFileW (Unicode) and CreateMetaFileA (ANSI)
Gdi32.lib
Gdi32.dll
Windows
19H1
CreateMetaFileA
wingdi/CreateMetaFileA
c++
APIRef
kbSyntax
DllExport
gdi32.dll
Ext-MS-Win-GDI-Metafile-l1-1-1.dll
ext-ms-win-gdi-metafile-l1-1-2.dll
Ext-MS-Win-GDI-Internal-Desktop-L1-1-0.dll
GDI32Full.dll
CreateMetaFile
CreateMetaFileA
CreateMetaFileW

CreateMetaFileA function

-description

The CreateMetaFile function creates a device context for a Windows-format metafile.

Note  This function is provided only for compatibility with Windows-format metafiles. Enhanced-format metafiles provide superior functionality and are recommended for new applications. The corresponding function for an enhanced-format metafile is CreateEnhMetaFile.
 

-parameters

-param pszFile [in]

A pointer to the file name for the Windows-format metafile to be created. If this parameter is NULL, the Windows-format metafile is memory based and its contents are lost when it is deleted by using the DeleteMetaFile function.

-returns

If the function succeeds, the return value is a handle to the device context for the Windows-format metafile.

If the function fails, the return value is NULL.

-remarks

Where text arguments must use Unicode characters, use the CreateMetaFile function as a wide-character function. Where text arguments must use characters from the Windows character set, use this function as an ANSI function.

CreateMetaFile is a Windows-format metafile function. This function supports only 16-bit Windows-based applications, which are listed in Windows-Format Metafiles. It does not record or play back GDI functions such as PolyBezier, which were not part of 16-bit Windows.

The device context created by this function can be used to record GDI output functions in a Windows-format metafile. It cannot be used with GDI query functions such as GetTextColor. When the device context is used with a GDI output function, the return value of that function becomes TRUE if the function is recorded and FALSE otherwise. When an object is selected by using the SelectObject function, only a copy of the object is recorded. The object still belongs to the application.

To create a scalable Windows-format metafile, record the graphics output in the MM_ANISOTROPIC mapping mode. The file cannot contain functions that modify the viewport origin and extents, nor can it contain device-dependent functions such as the SelectClipRgn function. Once created, the Windows metafile can be scaled and rendered to any output device-format by defining the viewport origin and extents of the picture before playing it.

Note

The wingdi.h header defines CreateMetaFile as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

-see-also

CloseMetaFile

CreateEnhMetaFile

DeleteMetaFile

GetTextColor

Metafile Functions

Metafiles Overview

SelectClipRgn

SelectObject