EpsImage Class
Base class for EPS format
Inheritance Hierarchy

Namespace: Aspose.Imaging.FileFormats.Eps
Assembly: Aspose.Imaging (in Aspose.Imaging.dll) Version: 21.05
Syntax
public abstract class EpsImage : VectorImage

The EpsImage type exposes the following members.

Constructors
  NameDescription
Protected methodEpsImage
Initializes a new instance of the EpsImage class
Properties
  NameDescription
Public propertyAutoAdjustPalette
Gets or sets a value indicating whether automatic adjust palette.
(Inherited from Image.)
Public propertyBackgroundColor
Gets or sets a value for the background color.
(Inherited from Image.)
Public propertyBitsPerPixel
Gets the image bits per pixel count.
(Overrides ImageBitsPerPixel.)
Public propertyBoundingBoxBottomLeft
Gets the bounding box bottom left position
Public propertyBoundingBoxString
Gets the BoundingBox string value
Public propertyBoundingBoxTopRight
Gets the bounding box top right position
Public propertyBounds
Gets the image bounds.
(Inherited from Image.)
Public propertyBufferSizeHint
Gets or sets the buffer size hint which is defined max allowed size for all internal buffers.
(Inherited from Image.)
Public propertyContainer
Gets the Image container.
(Inherited from Image.)
Public propertyCreationDate
Gets the CreationDate field
Public propertyCreationDateString
Gets he CreationDate field string value
Public propertyCreator
Gets the Creator field
Public propertyDataStreamContainer
Gets the object's data stream.
(Inherited from DataStreamSupporter.)
Public propertyDisposed
Gets a value indicating whether this instance is disposed.
(Inherited from DisposableObject.)
Public propertyEpsType
Gets EPS subtype value
Public propertyFileFormat
Gets a value of file format
(Overrides ImageFileFormat.)
Public propertyHasBackgroundColor
Gets or sets a value indicating whether image has background color.
(Inherited from Image.)
Public propertyHasRasterPreview
Gets a value indicating whether this instance has format-specific raster preview
Public propertyHeight
Gets the image height.
(Overrides VectorImageHeight.)
Public propertyHeightF
Gets the object height, in inches.
(Inherited from VectorImage.)
Public propertyInterruptMonitor
Gets or sets the interrupt monitor.
(Inherited from Image.)
Public propertyIsCached
Gets a value indicating whether object's data is cached currently and no data reading is required.
(Overrides DataStreamSupporterIsCached.)
Public propertyPageNumber
Gets the page number
Public propertyPagesCount
Gets the pages count
Public propertyPalette
Gets or sets the color palette. The color palette is not used when pixels are represented directly.
(Inherited from Image.)
Public propertyPhotoshopThumbnail
Gets Photoshop preview thumbnail (if it's present in initial EPS data)
Public propertyPostScriptVersion
Gets the PostScript version field
Public propertyPreviewToExport Obsolete.
Preview to use for export
Public propertyCode exampleSize
Gets the image size.
(Inherited from Image.)
Public propertySizeF
Gets the object size, in inches.
(Inherited from VectorImage.)
Public propertyTitle
Gets the Title field
Public propertyCode exampleUsePalette
Gets a value indicating whether the image palette is used.
(Inherited from Image.)
Public propertyWidth
Gets the image width.
(Overrides VectorImageWidth.)
Public propertyWidthF
Gets the object width, in inches.
(Inherited from VectorImage.)
Methods
  NameDescription
Public methodCacheData
Cache can not be used.
(Overrides DataStreamSupporterCacheData.)
Public methodCode exampleCanSave
Determines whether image can be saved to the specified file format represented by the passed save options.
(Inherited from Image.)
Public methodCode exampleDispose
Disposes the current instance.
(Inherited from DisposableObject.)
Protected methodDoAfterSave
Does the after save.
(Inherited from DataStreamSupporter.)
Protected methodDoUseRecursion
Gets value indicating whether use recursion for synchronization.
(Inherited from Image.)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize (Inherited from DisposableObject.)
Protected methodFinalizePhotoshopThumbnail
Finalizes Photoshop thumbnail by setting subformat-specific data
Protected methodGetCanNotSaveMessage
Gets the can not save message.
(Inherited from Image.)
Public methodGetDefaultOptions
Gets the default options.
(Overrides ImageGetDefaultOptions(Object).)
Protected methodGetFitRectangle(Rectangle)
Gets rectangle which fits the current image.
(Inherited from Image.)
Protected methodGetFitRectangle(Rectangle, Int32)
Gets rectangle which fits the current bitmap taking into account the pixels passed. The passed pixels array count should be equal to the fitting rectangle size.
(Inherited from Image.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Protected methodGetImage2Export
Gets the image to export.
(Inherited from Image.)
Public methodGetOriginalOptions
Gets the options based on the original file settings. This can be helpful to keep bit-depth and other parameters of the original image unchanged. For example, if we load a black-white PNG image with 1 bit per pixel and then save it using the Save(String) method, the output PNG image with 8-bit per pixel will be produced. To avoid it and save PNG image with 1-bit per pixel, use this method to get corresponding saving options and pass them to the Save(String, ImageOptionsBase) method as the second parameter.
(Inherited from Image.)
Protected methodGetPreviewImages
Gets the preview images.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDataStreamContainerChanging
Called when data stream container is changing.
(Inherited from DataStreamSupporter.)
Protected methodOnPaletteChanged
Called when palette is changed.
(Inherited from Image.)
Protected methodOnPaletteChanging
Called when palette is changing.
(Inherited from Image.)
Protected methodReleaseManagedResources
Releases the managed resources. Make sure no unmanaged resources are released here, since they may have been already released.
(Overrides ImageReleaseManagedResources.)
Protected methodReleaseUnmanagedResources
Releases the unmanaged resources. Make sure no managed resources are released here, since they may have been already released.
(Inherited from DisposableObject.)
Protected methodRenderPostScript
Renders the post script.
Public methodCode exampleResize(Int32, Int32)
Resizes the image. The default LeftTopToLeftTop is used.
(Inherited from Image.)
Public methodCode exampleResize(Int32, Int32, ImageResizeSettings)
Resizes the image.
(Overrides ImageResize(Int32, Int32, ImageResizeSettings).)
Public methodCode exampleResize(Int32, Int32, ResizeType)
Resizes the image.
(Overrides ImageResize(Int32, Int32, ResizeType).)
Public methodResizeHeightProportionally(Int32)
Resizes the height proportionally.
(Inherited from Image.)
Public methodResizeHeightProportionally(Int32, ImageResizeSettings)
Resizes the height proportionally.
(Inherited from Image.)
Public methodCode exampleResizeHeightProportionally(Int32, ResizeType)
Resizes the height proportionally.
(Inherited from Image.)
Protected methodResizePreviewImages
Resizes the preview images.
Public methodResizeWidthProportionally(Int32)
Resizes the width proportionally.
(Inherited from Image.)
Public methodResizeWidthProportionally(Int32, ImageResizeSettings)
Resizes the width proportionally.
(Inherited from Image.)
Public methodCode exampleResizeWidthProportionally(Int32, ResizeType)
Resizes the width proportionally.
(Inherited from Image.)
Public methodRotateFlip
Rotates, flips, or rotates and flips the image.
(Overrides ImageRotateFlip(RotateFlipType).)
Public methodCode exampleSave
Saves the image data to the underlying stream.
(Inherited from Image.)
Public methodSave(Stream)
Saves the object's data to the specified stream.
(Inherited from DataStreamSupporter.)
Public methodSave(String)
Saves the object's data to the specified file location.
(Inherited from DataStreamSupporter.)
Public methodSave(String, Boolean)
Saves the object's data to the specified file location.
(Inherited from DataStreamSupporter.)
Public methodCode exampleSave(Stream, ImageOptionsBase)
Saves the image's data to the specified stream in the specified file format according to save options.
(Inherited from Image.)
Public methodCode exampleSave(String, ImageOptionsBase)
Saves the object's data to the specified file location in the specified file format according to save options.
(Inherited from Image.)
Public methodCode exampleSave(Stream, ImageOptionsBase, Rectangle)
Saves the image's data to the specified stream in the specified file format according to save options.
(Inherited from Image.)
Public methodCode exampleSave(String, ImageOptionsBase, Rectangle)
Saves the object's data to the specified file location in the specified file format according to save options.
(Inherited from Image.)
Protected methodSaveData
Saves the data.
(Overrides DataStreamSupporterSaveData(Stream).)
Public methodSetPalette
Sets the image palette.
(Overrides ImageSetPalette(IColorPalette, Boolean).)
Protected methodSetSpecificRasterPreview
Sets the raster preview of EPS object

Note: EPS Interchange preview width must be divisible by 8, so it will be downscaled a bit if it is not

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodVerifyNotDisposed
Verifies that the current instance is not disposed.
(Inherited from DisposableObject.)
Fields
  NameDescription
Protected fieldTimeout
The timeout to wait for synchronization
(Inherited from DataStreamSupporter.)
Examples
Resize EPS image and export it to PNG format.
[C#]

// Load EPS image
using (var image = Image.Load("AstrixObelix.eps"))
{
    // Resize the image using the Mitchell cubic interpolation method
    image.Resize(400, 400, ResizeType.Mitchell);

    // Export image to PNG format
    image.Save("ExportResult.png", new PngOptions());
}
Examples
Convert EPS image to PDF using PostScript rendering.
[C#]

using (var image = (EpsImage)Image.Load("Sample.eps"))
{
    var options = new PdfOptions
    {
        PdfCoreOptions = new PdfCoreOptions
        {
            PdfCompliance = PdfComplianceVersion.PdfA1b // Set required PDF compliance
        }
    };

    image.Save("Sample.pdf", options);
}
Examples
Convert EPS image to PNG using PostScript rendering.
[C#]

using (var image = (EpsImage)Image.Load("Sample.eps"))
{
    var options = new PngOptions
    {
        VectorRasterizationOptions = new EpsRasterizationOptions
        {
            PageWidth = 500, // Image width
            PageHeight = 500 // Image height
            PreviewToExport = EpsPreviewFormat.PostScriptRendering; // Render raster image using the PostScript
        }
    };

    image.Save("Sample.png", options);
}
Examples
Resize EPS image using advanced settings.
[C#]

// Load EPS image
using (var image = Image.Load("AstrixObelix.eps"))
{
    // Resize the image using advanced resize settings
    image.Resize(400, 400, new ImageResizeSettings
    {
        // Set the interpolation mode
        Mode = ResizeType.LanczosResample,

        // Set the type of the filter
        FilterType = ImageFilterType.SmallRectangular,

        // Sets the color compare method
        ColorCompareMethod = ColorCompareMethod.Euclidian,

        // Set the color quantization method
        ColorQuantizationMethod = ColorQuantizationMethod.Popularity
    });

    // Export image to PNG format
    image.Save("ExportResult.png", new PngOptions());
}
See Also