Freigeben über


Metafile.GetMetafileHeader(IStream*, MetafileHeader*) method

Applies to: desktop apps only

The Metafile::GetMetafileHeader method gets the header.

Syntax

static Status GetMetafileHeader(
  [in]   IStream *stream,
  [out]  MetafileHeader *header
);

Parameters

  • 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.

Return value

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.

Examples

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;
}

Requirements

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

See also

Metafile

MetafileHeader

Loading and Displaying Metafiles

Metafiles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012