Class Metafile
Represents a Windows metafile (.wmf or .emf), which is a vector image format containing a sequence of drawing commands.
Implements
Inherited Members
Namespace: DRIT.Drawing.Imaging
Assembly: DRIT.Drawing.dll
Syntax
public sealed class Metafile : Image, IDisposable
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Constructors
Metafile(Stream)
Initializes a new Metafile from the specified stream.
Declaration
public Metafile(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to load from. |
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Metafile(string)
Initializes a new Metafile from the specified file.
Declaration
public Metafile(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The file to load from. |
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Properties
Flags
Gets the flags for this metafile.
Declaration
public override int Flags { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Height
Gets the height of this metafile in pixels.
Declaration
public override int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
PixelFormat
Gets the pixel format of this metafile.
Declaration
public override PixelFormat PixelFormat { get; }
Property Value
| Type | Description |
|---|---|
| PixelFormat |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
RawFormat
Gets the format of this metafile.
Declaration
public override ImageFormat RawFormat { get; }
Property Value
| Type | Description |
|---|---|
| ImageFormat |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Width
Gets the width of this metafile in pixels.
Declaration
public override int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Methods
Clone()
Creates an exact copy of this Metafile.
Declaration
public override Image Clone()
Returns
| Type | Description |
|---|---|
| Image | A new Metafile with the same content. |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
GetMetafileHeader()
Gets the metafile header information.
Declaration
public MetafileHeader GetMetafileHeader()
Returns
| Type | Description |
|---|---|
| MetafileHeader | The metafile header. |
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
RotateFlip(RotateFlipType)
Rotates and flips the metafile.
Declaration
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
| Type | Name | Description |
|---|---|---|
| RotateFlipType | rotateFlipType | The rotation and flip type. |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | This operation is not supported for vector metafiles. |
Save(Stream, ImageFormat)
Saves this metafile to the specified stream in the specified format.
Declaration
public override void Save(Stream stream, ImageFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| Stream | stream | The stream to save to. |
| ImageFormat | format | The format to save in. |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Save(string)
Saves this metafile to the specified file.
Declaration
public override void Save(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The file name to save to. |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
Save(string, ImageFormat)
Saves this metafile to the specified file in the specified format.
Declaration
public override void Save(string filename, ImageFormat format)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename | The file name to save to. |
| ImageFormat | format | The format to save in. |
Overrides
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.
ToBitmap()
Renders this metafile to a Bitmap.
Declaration
public Bitmap ToBitmap()
Returns
| Type | Description |
|---|---|
| Bitmap | The rendered bitmap. |
Remarks
A Metafile can be loaded from WMF or EMF files and rendered to a Bitmap using ToBitmap(). Metafiles are commonly used for scalable graphics that maintain quality at any resolution.