Class EmfImage
- Namespace
- Aspose.Imaging.FileFormats.Emf
- Assembly
- Aspose.Imaging.dll
The API for Enhanced Metafile Format (EMF) vector image format support is a comprehensive tool for processing graphical images in a device-independent manner while preserving their original properties. Developed to maintain proportions, dimensions, colors, and other graphic attributes, it includes EMF Plus format support and features for cropping regions, resizing canvas and images, rotating, flipping, setting image palettes, exporting and importing to APS device context, compressing and converting EMF to other formats, ensuring versatile manipulation and seamless integration of EMF images across applications.
public sealed class EmfImage : MetaImage, IDisposable, IObjectWithBounds, IObjectWithSizeF
- Inheritance
-
EmfImage
- Implements
- Inherited Members
Constructors
EmfImage()
Start working with EMF images by initializing a new instance of the EmfImage class. Ideal for quickly incorporating EMF images into your projects with ease and efficiency.
public EmfImage()
EmfImage(int, int)
Create a new instance of the EmfImage class by specifying the width and height parameters. This constructor simplifies the process of initializing EMF images with specific dimensions, enhancing the efficiency of your development workflow.
public EmfImage(int width, int height)
Parameters
Properties
BitsPerPixel
Retrieve the bit-per-pixel count specific to raster images, as this parameter doesn't apply to vector images. Quickly ascertain the pixel depth of raster images for precise analysis and manipulation, ensuring accurate handling of image data.
public override int BitsPerPixel { get; }
Property Value
- int
The image bits per pixel count.
Exceptions
- NotImplementedException
Invalid for vector images.
FileFormat
Access the file format value associated with the object. Easily determine the format of the file associated with the object for streamlined processing and compatibility checks. Simplify your workflow by retrieving the file format information with ease.
public override FileFormat FileFormat { get; }
Property Value
Header
Retrieve or modify the EMF metafile header record with this property. Ideal for managing metafile data efficiently within your application. Improve your workflow with streamlined access to metafile header information.
public EmfMetafileHeader Header { get; set; }
Property Value
Height
Retrieve the image's height, facilitating accurate rendering and layout adjustments. Accessing the height property ensures compatibility and seamless integration across different platforms and applications.
public override int Height { get; }
Property Value
- int
The image height.
IsCached
Access a value indicating whether the object's data is currently cached, eliminating the need for additional data reading. Enhance efficiency by quickly determining if cached data is available for immediate access. Optimize your workflow with streamlined data retrieval processes.
public override bool IsCached { get; }
Property Value
- bool
true
if object's data is cached; otherwise,false
.
Records
Retrieve or modify the records associated with the object. Efficiently access and manage the collection of records for enhanced data manipulation and processing. Optimize your workflow by seamlessly interacting with the object's records.
public override MetaObjectList Records { get; set; }
Property Value
- MetaObjectList
The records.
Width
Access to the width of the image, providing essential information for precise rendering and processing. Quickly retrieve the image's width to ensure compatibility and proper layout within various applications and platforms.
public override int Width { get; }
Property Value
- int
The image width.
Methods
CacheData()
Efficiently cache data and prevent redundant loading from the underlying DataStreamContainer with this method. Enhance performance and streamline data access in your application, optimizing resource utilization for improved responsiveness.
public override void CacheData()
Crop(Rectangle)
Crop the specified rectangle using this function. Ideal for refining image composition and focusing on specific areas of interest within the image. Improve visual clarity and highlight key details with precise cropping functionality.
public override void Crop(Rectangle rectangle)
Parameters
rectangle
RectangleThe rectangle.
GetDefaultOptions(object[])
Retrieve the default options for your image effortlessly. With this feature, you can quickly access the preset configurations, ensuring seamless integration and optimal performance for your projects. Ideal for streamlining your workflow and achieving consistent results across your images.
public override ImageOptionsBase GetDefaultOptions(object[] args)
Parameters
args
object[]The arguments.
Returns
- ImageOptionsBase
Default options
GetUsedFonts()
Retrieve the list of fonts utilized within the metafile with this method. Gain insights into font usage, facilitating efficient management and optimization of font resources for enhanced rendering and display fidelity.
public override string[] GetUsedFonts()
Returns
- string[]
The font list
Resize(int, int, ImageResizeSettings)
Adjust your image size with customizable settings, ensuring optimal dimensions and clarity. Perfect for tailoring images to specific requirements while maintaining quality.
public override void Resize(int newWidth, int newHeight, ImageResizeSettings settings)
Parameters
newWidth
intThe new width.
newHeight
intThe new height.
settings
ImageResizeSettingsThe resize settings.
Exceptions
- NotImplementedException
Not implemented.
Resize(int, int, ResizeType)
Resize your image effortlessly with this function, specifying the desired width, height, and type. Perfect for adjusting images to fit specific dimensions while maintaining clarity and quality. Ideal for optimizing images for various platforms and applications.
public override void Resize(int newWidth, int newHeight, ResizeType resizeType)
Parameters
newWidth
intThe new width.
newHeight
intThe new height.
resizeType
ResizeTypeThe resize type.
Exceptions
- NotImplementedException
Not implemented.
- NotImplementedException
Not implemented.
ResizeCanvas(Rectangle)
Resize the canvas with ease using this function. Perfect for adjusting the overall dimensions of the image without altering its content. Enhance presentation and prepare images for various display sizes effortlessly.
public override void ResizeCanvas(Rectangle newRectangle)
Parameters
newRectangle
RectangleThe new rectangle.
RotateFlip(RotateFlipType)
Easily rotate, flip, or perform both operations simultaneously on your image using
this simple RotateFlip()
method. Perfect for adjusting orientation and enhancing
visual appeal without hassle. Ideal for achieving the desired presentation of your
images in any project or application.
public override void RotateFlip(RotateFlipType rotateFlipType)
Parameters
rotateFlipType
RotateFlipTypeType of the rotate flip.
Exceptions
- NotImplementedException
Not implemented.
SaveData(Stream)
protected override void SaveData(Stream stream)
Parameters
stream
Stream
SetPalette(IColorPalette, bool)
Enhance your image's color palette by setting it with the specified
IColorPalette
. Achieve vivid, vibrant visuals with ease, ensuring your images
stand out and captivate viewers. Ideal for optimizing color schemes and achieving
the perfect look for your projects.
public override void SetPalette(IColorPalette palette, bool updateColors)
Parameters
palette
IColorPaletteThe palette to set.
updateColors
boolif set to
true
colors will be updated according to the new palette; otherwise color indexes remain unchanged. Note that unchanged indexes may crash the image on loading if some indexes have no corresponding palette entries.
Exceptions
- NotImplementedException
Invalid for vector images