Metafile Constructors

Definition

Initializes a new instance of the Metafile class.

Overloads

Metafile(Stream)

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

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit)

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.

Metafile(String, IntPtr, EmfType, String)

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.

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit)

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.

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit)

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.

Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

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.

Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

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.

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType)

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.

Metafile(Stream, IntPtr, EmfType, String)

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.

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType)

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.

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, String)

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.

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType)

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.

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, String)

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.

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

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.

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

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.

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

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.

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

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.

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType)

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.

Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType)

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.

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit)

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.

Metafile(String, IntPtr, RectangleF)

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.

Metafile(String)

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

Metafile(IntPtr, Boolean)

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

Metafile(IntPtr, 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.

Metafile(IntPtr, WmfPlaceableFileHeader)

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

Metafile(IntPtr, Rectangle)

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

Metafile(IntPtr, RectangleF)

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

Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType)

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.

Metafile(String, IntPtr)

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

Metafile(IntPtr, EmfType, String)

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.

Metafile(Stream, IntPtr)

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

Metafile(IntPtr, Rectangle, MetafileFrameUnit)

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.

Metafile(IntPtr, RectangleF, MetafileFrameUnit)

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.

Metafile(Stream, IntPtr, EmfType)

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.

Metafile(Stream, IntPtr, Rectangle)

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.

Metafile(Stream, IntPtr, RectangleF)

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.

Metafile(String, IntPtr, EmfType)

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.

Metafile(String, IntPtr, Rectangle)

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.

Metafile(IntPtr, WmfPlaceableFileHeader, Boolean)

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.

Metafile(Stream)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(System.IO.Stream stream);

Parameters

stream
Stream

The Stream from which to create the new Metafile.

Exceptions

stream is null.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle structure that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? desc);
C#
public Metafile(IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string desc);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

desc
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string? description);
C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string description);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string? desc);
C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string desc);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

desc
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A String that contains a descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, RectangleF)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(string filename);

Parameters

filename
String

A String that represents the file name from which to create the new Metafile.

Examples

The following code example demonstrates how to create and use a Metafile.

C#

using System;
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows.Forms;

// for Marshal.Copy
using System.Runtime.InteropServices; 

public class Form1 : Form
{
    private Metafile metafile1;
    private Graphics.EnumerateMetafileProc metafileDelegate;
    private Point destPoint;
    public Form1()
    {
        metafile1 = new Metafile(@"C:\Test.wmf");
        metafileDelegate = new Graphics.EnumerateMetafileProc(MetafileCallback);
        destPoint = new Point(20, 10);
    }
    protected override void OnPaint(PaintEventArgs e)
    {
        e.Graphics.EnumerateMetafile(metafile1, destPoint, metafileDelegate);
    }
    private bool MetafileCallback(
       EmfPlusRecordType recordType,
       int flags,
       int dataSize,
       IntPtr data,
       PlayRecordCallback callbackData)
    {
        byte[] dataArray = null;
        if (data != IntPtr.Zero)
        {
            // Copy the unmanaged record to a managed byte buffer 
            // that can be used by PlayRecord.
            dataArray = new byte[dataSize];
            Marshal.Copy(data, dataArray, 0, dataSize);
        }

        metafile1.PlayRecord(recordType, flags, dataSize, dataArray);

        return true;
    }

    static void Main()
    {
        Application.Run(new Form1());
    }
}

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, Boolean)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(IntPtr henhmetafile, bool deleteEmf);

Parameters

henhmetafile
IntPtr

A handle to an enhanced metafile.

deleteEmf
Boolean

true to delete the enhanced metafile handle when the Metafile is deleted; otherwise, false.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType);

Parameters

referenceHdc
IntPtr

The handle to a device context.

emfType
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, WmfPlaceableFileHeader)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader);

Parameters

hmetafile
IntPtr

A windows handle to a Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, Rectangle)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Rectangle frameRect);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, RectangleF)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(IntPtr referenceHdc, System.Drawing.RectangleF frameRect);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(string fileName, IntPtr referenceHdc);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, EmfType, String)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType, string? description);
C#
public Metafile(IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType, string description);

Parameters

referenceHdc
IntPtr

The handle to a device context.

emfType
EmfType

An EmfType that specifies the format of the Metafile.

description
String

A descriptive name for the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, Rectangle, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, RectangleF, MetafileFrameUnit)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);

Parameters

referenceHdc
IntPtr

The handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

frameUnit
MetafileFrameUnit

A MetafileFrameUnit that specifies the unit of measure for frameRect.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, Rectangle)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(Stream, IntPtr, RectangleF)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect);

Parameters

stream
Stream

A Stream that contains the data for this Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
RectangleF

A RectangleF that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, EmfType)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

type
EmfType

An EmfType that specifies the format of the Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(String, IntPtr, Rectangle)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect);

Parameters

fileName
String

A String that represents the file name of the new Metafile.

referenceHdc
IntPtr

A Windows handle to a device context.

frameRect
Rectangle

A Rectangle that represents the rectangle that bounds the new Metafile.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

Metafile(IntPtr, WmfPlaceableFileHeader, Boolean)

Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs
Source:
Metafile.cs

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.

C#
public Metafile(IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader, bool deleteWmf);

Parameters

hmetafile
IntPtr

A windows handle to a Metafile.

deleteWmf
Boolean

true to delete the handle to the new Metafile when the Metafile is deleted; otherwise, false.

Applies to

.NET 10 (package-provided) and other versions
Product Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0 (package-provided)
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10