Metafile.GetMetafileHeader(IStream*, MetafileHeader*) method
Applies to: desktop apps only
The Metafile::GetMetafileHeader method gets the header.
static Status GetMetafileHeader(
[in] IStream *stream,
[out] MetafileHeader *header
);
stream [in]
Type: IStream*Pointer to a COM IStream interface that points to a stream of data in a file.
header [out]
Type: MetafileHeader*Pointer to a MetafileHeader object that receives the header, which contains the attributes of the metafile.
Type:
Type: Status****
If the method succeeds, it returns OK, which is an element of the Status enumeration.
If the method fails, it returns one of the other elements of the Status enumeration.
The following example creates a Metafile object from an EMF+ file and gets the metafile header. The code then creates a pointer to a COM IStream interface and gets the metafile header.
{
Graphics graphics(hdc);
// Create a Metafile object from an EMF+ file.
Metafile metafile = new Metafile(L"file1.emf+");
// Create a MetafileHeader object.
MetafileHeader metaHeader;
// Create a pointer to a COM IStream interface.
IStream pStream = NULL;
// Get the MetafileHeader.
metafile->GetMetafileHeader(pStream, &metaHeader);
// Delete the metafile.
delete metafile;
}
Minimum supported client |
Windows XP, Windows 2000 Professional |
Minimum supported server |
Windows 2000 Server |
Product |
GDI+ 1.0 |
Header |
Gdiplusmetafile.h (include Gdiplus.h) |
Library |
Gdiplus.lib |
DLL |
Gdiplus.dll |
Loading and Displaying Metafiles
Send comments about this topic to Microsoft
Build date: 3/6/2012