Metafile 构造函数
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
初始化 Metafile 类的新实例。
重载
Metafile(Stream)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的数据流初始化 Metafile 类的新实例。
public:
Metafile(System::IO::Stream ^ stream);
public Metafile (System.IO.Stream stream);
new System.Drawing.Imaging.Metafile : System.IO.Stream -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream)
参数
例外
stream
为 null
。
适用于
Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的数据流、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)和所提供的度量单位初始化 Metafile 类的新实例。
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(String, IntPtr, Rectangle, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, RectangleF, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
用指定的文件名、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)和所提供的度量单位初始化 Metafile 类的新实例。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ desc);
public Metafile (IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string desc);
public Metafile (IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? desc);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType, desc As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);
public Metafile (IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的数据流、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)、所提供的度量单位以及指定 Metafile 格式的 EmfType 枚举初始化 Metafile 类的新实例。
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::String ^ description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string? description);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * string -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
用指定的文件名、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)、所提供的度量单位以及指定 Metafile 格式的 EmfType 枚举初始化 Metafile 类的新实例。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
用指定的文件名、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)和所提供的度量单位初始化 Metafile 类的新实例。 还可添加描述性字符串。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::String ^ desc);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string desc);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, string? desc);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * string -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, desc As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, RectangleF, MetafileFrameUnit, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
用指定的文件名、设备上下文的 Windows 图柄、RectangleF 结构(它表示绑定新 Metafile 的矩形)、所提供的度量单位以及指定 Metafile 格式的 EmfType 枚举初始化 Metafile 类的新实例。 还可添加描述性字符串。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type, System::String ^ description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string description);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type, string? description);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, Rectangle, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(IntPtr, RectangleF, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, Rectangle, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr, RectangleF)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
用指定的文件名、设备上下文的 Windows 图柄和 RectangleF 结构(它表示绑定新 Metafile 的矩形)初始化 Metafile 类的新实例。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::RectangleF frameRect);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.RectangleF frameRect);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.RectangleF -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As RectangleF)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
适用于
Metafile(String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的文件名初始化 Metafile 类的新实例。
public:
Metafile(System::String ^ filename);
public Metafile (string filename);
new System.Drawing.Imaging.Metafile : string -> System.Drawing.Imaging.Metafile
Public Sub New (filename As String)
参数
示例
下面的代码示例演示如何创建和使用 Metafile。
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());
}
}
Imports System.Drawing
Imports System.Drawing.Imaging
Imports System.Windows.Forms
' for Marshal.Copy
Imports System.Runtime.InteropServices
Public Class Form1
Inherits Form
Private metafile1 As Metafile
Private metafileDelegate As Graphics.EnumerateMetafileProc
Private destPoint As Point
Public Sub New()
metafile1 = New Metafile("C:\test.wmf")
metafileDelegate = New Graphics.EnumerateMetafileProc(AddressOf MetafileCallback)
destPoint = New Point(20, 10)
End Sub
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
e.Graphics.EnumerateMetafile(metafile1, destPoint, metafileDelegate)
End Sub
Private Function MetafileCallback(ByVal recordType As _
EmfPlusRecordType, ByVal flags As Integer, ByVal dataSize As Integer, _
ByVal data As IntPtr, ByVal callbackData As PlayRecordCallback) As Boolean
Dim dataArray As Byte() = Nothing
If data <> IntPtr.Zero Then
' 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)
End If
metafile1.PlayRecord(recordType, flags, dataSize, dataArray)
Return True
End Function
Shared Sub Main()
Application.Run(New Form1())
End Sub
End Class
适用于
Metafile(IntPtr, Boolean)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的图柄初始化 Metafile 类的新实例。
public:
Metafile(IntPtr henhmetafile, bool deleteEmf);
public Metafile (IntPtr henhmetafile, bool deleteEmf);
new System.Drawing.Imaging.Metafile : nativeint * bool -> System.Drawing.Imaging.Metafile
Public Sub New (henhmetafile As IntPtr, deleteEmf As Boolean)
参数
- henhmetafile
-
IntPtr
nativeint
增强型图元文件的图柄。
适用于
Metafile(IntPtr, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::Imaging::EmfType emfType);
public Metafile (IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, emfType As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
适用于
Metafile(IntPtr, WmfPlaceableFileHeader)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的图柄和 WmfPlaceableFileHeader 初始化 Metafile 类的新实例。
public:
Metafile(IntPtr hmetafile, System::Drawing::Imaging::WmfPlaceableFileHeader ^ wmfHeader);
public Metafile (IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Imaging.WmfPlaceableFileHeader -> System.Drawing.Imaging.Metafile
Public Sub New (hmetafile As IntPtr, wmfHeader As WmfPlaceableFileHeader)
参数
- wmfHeader
- WmfPlaceableFileHeader
适用于
Metafile(IntPtr, Rectangle)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的设备上下文初始化 Metafile 类的新实例,该实例由指定的矩形绑定。
public:
Metafile(IntPtr referenceHdc, System::Drawing::Rectangle frameRect);
public Metafile (IntPtr referenceHdc, System.Drawing.Rectangle frameRect);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Rectangle -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As Rectangle)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
适用于
Metafile(IntPtr, RectangleF)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的设备上下文初始化 Metafile 类的新实例,该实例由指定的矩形绑定。
public:
Metafile(IntPtr referenceHdc, System::Drawing::RectangleF frameRect);
public Metafile (IntPtr referenceHdc, System.Drawing.RectangleF frameRect);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.RectangleF -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As RectangleF)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
适用于
Metafile(IntPtr, Rectangle, MetafileFrameUnit, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit, System::Drawing::Imaging::EmfType type);
public Metafile (IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(String, IntPtr)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
使用指定的文件名初始化 Metafile 类的新实例。
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc);
public Metafile (string fileName, IntPtr referenceHdc);
new System.Drawing.Imaging.Metafile : string * nativeint -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(IntPtr, EmfType, String)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(IntPtr referenceHdc, System::Drawing::Imaging::EmfType emfType, System::String ^ description);
public Metafile (IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType, string description);
public Metafile (IntPtr referenceHdc, System.Drawing.Imaging.EmfType emfType, string? description);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Imaging.EmfType * string -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, emfType As EmfType, description As String)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
适用于
Metafile(Stream, IntPtr)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的数据流初始化 Metafile 类的新实例。
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(IntPtr, Rectangle, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的设备上下文初始化 Metafile 类的新实例,该实例由使用提供的度量单位的指定矩形绑定。
public:
Metafile(IntPtr referenceHdc, System::Drawing::Rectangle frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (IntPtr referenceHdc, System.Drawing.Rectangle frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Rectangle * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As Rectangle, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(IntPtr, RectangleF, MetafileFrameUnit)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的设备上下文初始化 Metafile 类的新实例,该实例由使用提供的度量单位的指定矩形绑定。
public:
Metafile(IntPtr referenceHdc, System::Drawing::RectangleF frameRect, System::Drawing::Imaging::MetafileFrameUnit frameUnit);
public Metafile (IntPtr referenceHdc, System.Drawing.RectangleF frameRect, System.Drawing.Imaging.MetafileFrameUnit frameUnit);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.RectangleF * System.Drawing.Imaging.MetafileFrameUnit -> System.Drawing.Imaging.Metafile
Public Sub New (referenceHdc As IntPtr, frameRect As RectangleF, frameUnit As MetafileFrameUnit)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
- frameUnit
- MetafileFrameUnit
MetafileFrameUnit,指定 frameRect
的度量单位。
适用于
Metafile(Stream, IntPtr, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Imaging::EmfType type);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(Stream, IntPtr, Rectangle)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::Rectangle frameRect);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.Rectangle frameRect);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.Rectangle -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As Rectangle)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(Stream, IntPtr, RectangleF)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的数据流、设备上下文的 Windows 图柄和 RectangleF 结构(它表示绑定新 Metafile 的矩形)初始化 Metafile 类的新实例。
public:
Metafile(System::IO::Stream ^ stream, IntPtr referenceHdc, System::Drawing::RectangleF frameRect);
public Metafile (System.IO.Stream stream, IntPtr referenceHdc, System.Drawing.RectangleF frameRect);
new System.Drawing.Imaging.Metafile : System.IO.Stream * nativeint * System.Drawing.RectangleF -> System.Drawing.Imaging.Metafile
Public Sub New (stream As Stream, referenceHdc As IntPtr, frameRect As RectangleF)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
- frameRect
- RectangleF
一个 RectangleF,表示绑定新 Metafile 的矩形。
适用于
Metafile(String, IntPtr, EmfType)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Imaging::EmfType type);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Imaging.EmfType type);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Imaging.EmfType -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, type As EmfType)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(String, IntPtr, Rectangle)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
public:
Metafile(System::String ^ fileName, IntPtr referenceHdc, System::Drawing::Rectangle frameRect);
public Metafile (string fileName, IntPtr referenceHdc, System.Drawing.Rectangle frameRect);
new System.Drawing.Imaging.Metafile : string * nativeint * System.Drawing.Rectangle -> System.Drawing.Imaging.Metafile
Public Sub New (fileName As String, referenceHdc As IntPtr, frameRect As Rectangle)
参数
- referenceHdc
-
IntPtr
nativeint
设备上下文的 Windows 图柄。
适用于
Metafile(IntPtr, WmfPlaceableFileHeader, Boolean)
- Source:
- Metafile.cs
- Source:
- Metafile.cs
- Source:
- Metafile.cs
从指定的图柄和 WmfPlaceableFileHeader 初始化 Metafile 类的新实例。 另外,deleteWmf
参数可用于在删除图元文件时删除图柄。
public:
Metafile(IntPtr hmetafile, System::Drawing::Imaging::WmfPlaceableFileHeader ^ wmfHeader, bool deleteWmf);
public Metafile (IntPtr hmetafile, System.Drawing.Imaging.WmfPlaceableFileHeader wmfHeader, bool deleteWmf);
new System.Drawing.Imaging.Metafile : nativeint * System.Drawing.Imaging.WmfPlaceableFileHeader * bool -> System.Drawing.Imaging.Metafile
Public Sub New (hmetafile As IntPtr, wmfHeader As WmfPlaceableFileHeader, deleteWmf As Boolean)
参数
- wmfHeader
- WmfPlaceableFileHeader