<PackageReference Include="System.Drawing.Common" Version="9.0.5" />

Metafile

public sealed class Metafile : Image
Defines a graphic metafile. A metafile contains records that describe a sequence of graphics operations that can be recorded (constructed) and played back (displayed). This class is not inheritable.
public Metafile(IntPtr henhmetafile, bool deleteEmf)

Initializes a new instance of the Metafile class from the specified handle.

public Metafile(IntPtr referenceHdc, EmfType emfType)

Initializes a new instance of the Metafile class from the specified handle to a device context and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(IntPtr referenceHdc, EmfType emfType, string description)

Initializes a new instance of the Metafile class from the specified handle to a device context and an EmfType enumeration that specifies the format of the Metafile. A string can be supplied to name the file.

public Metafile(IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)

Initializes a new instance of the Metafile class from the specified handle and a WmfPlaceableFileHeader.

public Metafile(IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader, bool deleteWmf)

Initializes a new instance of the Metafile class from the specified handle and a WmfPlaceableFileHeader. Also, the deleteWmf parameter can be used to delete the handle when the metafile is deleted.

public Metafile(IntPtr referenceHdc, Rectangle frameRect)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle.

public Metafile(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure.

public Metafile(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, string desc)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A string can be provided to name the file.

public Metafile(IntPtr referenceHdc, RectangleF frameRect)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle.

public Metafile(IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure.

public Metafile(IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)

Initializes a new instance of the Metafile class from the specified device context, bounded by the specified rectangle that uses the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A string can be provided to name the file.

public Metafile(Stream stream)

Initializes a new instance of the Metafile class from the specified data stream.

public Metafile(Stream stream, IntPtr referenceHdc)

Initializes a new instance of the Metafile class from the specified data stream.

public Metafile(Stream stream, IntPtr referenceHdc, EmfType type)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(Stream stream, IntPtr referenceHdc, EmfType type, string description)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, and an EmfType enumeration that specifies the format of the Metafile. Also, a string that contains a descriptive name for the new Metafile can be added.

public Metafile(Stream stream, IntPtr referenceHdc, Rectangle frameRect)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, and a Rectangle structure that represents the rectangle that bounds the new Metafile.

public Metafile(Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure.

public Metafile(Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(Stream stream, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A string that contains a descriptive name for the new Metafile can be added.

public Metafile(Stream stream, IntPtr referenceHdc, RectangleF frameRect)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, and a RectangleF structure that represents the rectangle that bounds the new Metafile.

public Metafile(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure.

public Metafile(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(Stream stream, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)

Initializes a new instance of the Metafile class from the specified data stream, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A string that contains a descriptive name for the new Metafile can be added.

public Metafile(string filename)

Initializes a new instance of the Metafile class from the specified file name.

public Metafile(string fileName, IntPtr referenceHdc)

Initializes a new instance of the Metafile class with the specified file name.

public Metafile(string fileName, IntPtr referenceHdc, EmfType type)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(string fileName, IntPtr referenceHdc, EmfType type, string description)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, and an EmfType enumeration that specifies the format of the Metafile. A descriptive string can be added, as well.

public Metafile(string fileName, IntPtr referenceHdc, Rectangle frameRect)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, and a Rectangle structure that represents the rectangle that bounds the new Metafile.

public Metafile(string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure.

public Metafile(string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A descriptive string can also be added.

public Metafile(string fileName, IntPtr referenceHdc, Rectangle frameRect, MetafileFrameUnit frameUnit, string description)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a Rectangle structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure. A descriptive string can also be added.

public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, and a RectangleF structure that represents the rectangle that bounds the new Metafile.

public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure.

public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile.

public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, EmfType type, string description)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, the supplied unit of measure, and an EmfType enumeration that specifies the format of the Metafile. A descriptive string can also be added.

public Metafile(string fileName, IntPtr referenceHdc, RectangleF frameRect, MetafileFrameUnit frameUnit, string desc)

Initializes a new instance of the Metafile class with the specified file name, a Windows handle to a device context, a RectangleF structure that represents the rectangle that bounds the new Metafile, and the supplied unit of measure. A descriptive string can also be added.

public static MetafileHeader GetMetafileHeader(IntPtr henhmetafile)

Returns the MetafileHeader associated with the specified Metafile.

public static MetafileHeader GetMetafileHeader(IntPtr hmetafile, WmfPlaceableFileHeader wmfHeader)

Returns the MetafileHeader associated with the specified Metafile.

public static MetafileHeader GetMetafileHeader(Stream stream)

Returns the MetafileHeader associated with the specified Metafile.

public static MetafileHeader GetMetafileHeader(string fileName)

Returns the MetafileHeader associated with the specified Metafile.

public IntPtr GetHenhmetafile()

Returns a Windows handle to an enhanced Metafile.

Returns the MetafileHeader associated with this Metafile.

public void PlayRecord(EmfPlusRecordType recordType, int flags, int dataSize, byte[] data)

Plays an individual metafile record.