Graphics.AddMetafileComment method

Applies to: desktop apps only

The Graphics::AddMetafileComment method adds a text comment to an existing metafile.

Syntax

Status AddMetafileComment(
  [in]  const BYTE *data,
  [in]  UINT sizeData
);

Parameters

data [in]

Type: const BYTE*

Pointer to a buffer that contains the comment.

sizeData [in]

Type: UINT

Integer that specifies the number of bytes in the value of the data parameter.

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, adds a comment to the metafile, and then draws the metafile.


VOID VOID Example_AddMetafileComment(HDC hdc)
{
   Graphics graphics(hdc);

   // Create a Metafile object for recording.
   Metafile metaFile(L"SampleMeta.emf", hdc);
   {
   Graphics metaGraphics(&metaFile);

   // Draw a rectangle in metaFile.
   Pen pen(Color(255, 0, 0, 0));
   metaGraphics.DrawRectangle(&pen, 0, 0, 100, 100);

   // Create a comment, and add it to metaFile.
   BYTE metaComment[] = "Test";
   metaGraphics.AddMetafileComment(metaComment, 4);
   }

   // Draw metaFile.
   graphics.DrawImage(&metaFile, Point(0, 0));
}

Requirements

Minimum supported client

Windows XP, Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Product

GDI+ 1.0

Header

Gdiplusgraphics.h (include Gdiplus.h)

Library

Gdiplus.lib

DLL

Gdiplus.dll

See also

Graphics
MetafileHeader
Metafile
Loading and Displaying Metafiles
Metafiles

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Additions

ADD
Show: