勇芳软件工作室.汉化:  Metafiles > Metafile Functions >

GdiComment

Previous pageReturn to chapter overviewNext page

描述

 

GdiComment函数将注释从缓冲区复制到指定的增强型格式的图元文件中。

 

C++ 语法

 

BOOL GdiComment(

__in HDC hdc,

__in UINT cbSize,

__in const BYTE *lpData

);

 

PowerBASIC 语法

 

FUNCTION GdiComment ( _

BYVAL hdc AS DWORD, _

BYVAL cbSize AS DWORD, _

BYVAL lpData AS BYTE PTR _

) AS LONG

 

参数

 

hdc

 

[in]处理增强型图元文件设备上下文。

 

cbSize

 

[in]指定注释缓冲区的长度(以字节为单位)。

 

lpData

 

[in]指向包含注释的缓冲区的指针。

 

返回值

 

如果函数成功,返回值不为零。

 

如果函数失败,返回值为零。

 

备注

 

评论可以包括任何种类的私人信息,例如图片的来源和创建的日期。注释应以应用程序签名开头,后跟数据。

 

注释不应包含特定于应用程序或位置的数据。位置特定的数据指定记录的位置,并且不应该包括一个元文件,因为一个图元文件可能嵌入在另一个元文件中。

 

公众评论是以注释签名标识符GDICOMMENT_IDENTIFIER开头的评论。定义了以下公众意见。

 

GDICOMMENT_WINDOWS_METAFILE

 

GDICOMMENT_WINDOWS_METAFILE公共评论包含一个等同于增强格式的图元文件的Windows格式的图元文件。此评论仅由SetWinMetaFileBits功能编写。评论记录(如果给出)遵循ENHMETAHEADER图元文件记录。评论的格式如下:

 

DWORD ident;         // This contains GDICOMMENT_IDENTIFIER. 

DWORD iComment;      // This contains GDICOMMENT_WINDOWS_METAFILE. 

DWORD nVersion;      // This contains the version number of the 

                    // Windows-format metafile. 

DWORD nChecksum;     // This is the additive DWORD checksum for 

                    // the enhanced metafile.  The checksum 

                    // for the enhanced metafile data including 

                    // this comment record must be zero. 

                    // Otherwise, the enhanced metafile has been 

                    //  modified and the Windows-format 

                    // metafile is no longer valid. 

DWORD fFlags;        // This must be zero. 

DWORD cbWinMetaFile; // This is the size, in bytes. of the 

                    // Windows-format metafile data that follows. 

 

GDICOMMENT_BEGINGROUP

 

GDICOMMENT_BEGINGROUP公共评论标识一组绘图记录的开头。它识别增强图元文件中的一个对象。评论的格式如下:

 

DWORD   ident;         // This contains GDICOMMENT_IDENTIFIER. 

DWORD   iComment;      // This contains GDICOMMENT_BEGINGROUP. 

RECTL   rclOutput;     // This is the bounding rectangle for the 

                      // object in logical coordinates. 

DWORD   nDescription;  // This is the number of characters in the 

                      // optional Unicode description string that 

                      // follows. This is zero if there is no 

                      // description string.

 

GDICOMMENT_ENDGROUP

 

GDICOMMENT_ENDGROUP公开评论标识了一组绘图记录的结尾。GDICOMMENT_BEGINGROUP注释和GDICOMMENT_ENDGROUP注释必须包含在一对中,并可能嵌套。评论的格式如下:

 

DWORD   ident;       // This contains GDICOMMENT_IDENTIFIER. 

DWORD   iComment;    // This contains GDICOMMENT_ENDGROUP. 

 

GDICOMMENT_MULTIFORMATS

 

Windows NT 4.0 SP4及更早版本,Windows 95/98 / Me:GDICOMMENT_MULTIFORMATS公共评论允许将图片的多个定义包含在增强型图元文件中。例如,使用此注释,应用程序可以包括封装的PostScript定义以及图片的增强图元文件定义。当录制回放时,GDI会选择并呈现设备识别的第一种格式。评论的格式如下:

 

DWORD   ident;          // This contains GDICOMMENT_IDENTIFIER. 

DWORD   iComment;       // This contains GDICOMMENT_MULTIFORMATS. 

RECTL   rclOutput;      // This is the bounding rectangle for the 

                       // picture in logical coordinates. 

DWORD   nFormats;       // This contains the number of formats in 

                       // the comment. 

EMRFORMAT aemrformat[1];// This is an array of EMRFORMAT structures 

                       // in the order of preference.  The data 

                       // for each format follows the last 

                       // EMRFORMAT structure.

 

引用文件 #INCLUDE Once

 

WinGdi.inc(包括Windows.inc)