Graphics::EnumerateMetafile 方法为指定图元文件中的每条记录调用应用程序定义的回调函数。 可以通过在回调函数中调用 PlayRecord 来使用此方法来显示图元文件。
语法
Status EnumerateMetafile(
  [in]      const Metafile        *metafile,
  [in]      const PointF          *destPoints,
  [in]      INT                   count,
  [in, ref] const RectF &         srcRect,
  [in]      Unit                  srcUnit,
  [in]      EnumerateMetafileProc callback,
  [in]      VOID                  *callbackData,
  [in]      const ImageAttributes *imageAttributes
);
参数
[in] metafile
类型: const 图元文件*
指向要枚举的图元文件的指针。
[in] destPoints
类型: const Point*
指向目标点数组的指针。 这是一个包含三个点的数组,用于定义所显示图元文件的目标平行四边形。
[in] count
类型: INT
指定 destPoints 数组中的点数的整数。
[in, ref] srcRect
类型: const RectF
对矩形的引用,该矩形指定显示的图元文件部分。
[in] srcUnit
类型: 单位
指定源矩形的度量单位的 Unit 枚举的元素。
[in] callback
类型: EnumerateMetafileProc
指向应用程序定义的回调函数的指针。 回调函数的原型在 Gdiplustypes.h 中提供。
[in] callbackData
类型: VOID*
可选。 指向传递给回调函数的数据块的指针。 默认值为 NULL。
[in] imageAttributes
类型: ImageAttributes*
可选。 指向 ImageAttributes 对象的指针,该对象指定显示图元文件的颜色调整。 默认值为 NULL。
返回值
类型: 状态
如果方法成功,则返回 Ok,这是 Status 枚举的元素。
如果 方法失败,它将返回 Status 枚举的其他元素之一。
要求
| 要求 | 值 | 
|---|---|
| 最低受支持的客户端 | Windows XP、Windows 2000 Professional [仅限桌面应用] | 
| 最低受支持的服务器 | Windows 2000 Server [仅限桌面应用] | 
| 目标平台 | Windows | 
| 标头 | gdiplusgraphics.h (包括 Gdiplus.h) | 
| Library | Gdiplus.lib | 
| DLL | Gdiplus.dll |