This documentation is archived and is not being maintained.

Graphics.EnumerateMetafile Method (Metafile, PointF[], RectangleF, GraphicsUnit, Graphics.EnumerateMetafileProc)

.NET Framework 1.1

Sends the records in a selected rectangle from a Metafile object, one at a time, to a callback method for display in a specified parallelogram.

[Visual Basic]
Overloads Public Sub EnumerateMetafile( _
   ByVal metafile As Metafile, _
   ByVal destPoints() As PointF, _
   ByVal srcRect As RectangleF, _
   ByVal srcUnit As GraphicsUnit, _
   ByVal callback As Graphics.EnumerateMetafileProc _
public void EnumerateMetafile(
 Metafile metafile,
 PointF[] destPoints,
 RectangleF srcRect,
 GraphicsUnit srcUnit,
 Graphics.EnumerateMetafileProc callback
public: void EnumerateMetafile(
 Metafile* metafile,
 PointF destPoints[],
 RectangleF srcRect,
 GraphicsUnit srcUnit,
 Graphics.EnumerateMetafileProc* callback
public function EnumerateMetafile(
   metafile : Metafile,
 destPoints : PointF[],
 srcRect : RectangleF,
 srcUnit : GraphicsUnit,
 callback : Graphics.EnumerateMetafileProc


Metafile object to enumerate.
Array of three PointF structures that define a parallelogram that determines the size and location of the drawn metafile.
RectangleF structures that specifies the portion of the metafile, relative to its upper-left corner, to draw.
Member of the GraphicsUnit enumeration that specifies the unit of measure used to determine the portion of the metafile that the rectangle specified by the srcRect parameter contains.
Graphics.EnumerateMetafileProc delegate that specifies the method to which the metafile records are sent.

Return Value

This method does not return a value.


This method enumerates the records contained in the specified metafile. Each record is individually sent to a callback method specified by the callback parameter. Typically, the callback method calls the PlayRecord method to "play back", or draw, the record.

If the callback method calls Metafile.PlayRecord, it must do so by calling the PlayRecord method of the specific Metafile object that is being enumerated.

The destPoints parameter specifies three points of a parallelogram. The three Point structures represent the upper-left, upper-right, and lower-left corners of the parallelogram. The fourth point is extrapolated from the first three to form a parallelogram. The drawn metafile is scaled and sheared to fit the parallelogram.

Any drawing that takes place outside of the rectangle specified by the srcRect parameter is ignored.


For an example see EnumerateMetafile.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

Graphics Class | Graphics Members | System.Drawing Namespace | Graphics.EnumerateMetafile Overload List