Class EpsImage

Class EpsImage

名称: Aspose.Imaging.FileFormats.Eps 收藏: Aspose.Imaging.dll (25.4.0)

API for Encapsulated PostScript (EPS) 图像文件格式支持强大的操作能力,包括文本、图形、和图像. 有功能,如 bitmap preview 图像处理,导向flipping,bounding box retrieval for illustration boundings,重振,旋转图像,并添加预览图像,这个API确保无缝处理并将 EPS 文件集成到各种应用程序中,以准确性和多元性。

[JsonObject(MemberSerialization.OptIn)]
public sealed class EpsImage : VectorImage, IDisposable, IObjectWithBounds, IObjectWithSizeF

Inheritance

object DisposableObject DataStreamSupporter Image VectorImage EpsImage

Implements

IDisposable , IObjectWithBounds , IObjectWithSizeF

继承人

VectorImage.GetEmbeddedImages() , VectorImage.RemoveBackground() , VectorImage.RemoveBackground(RemoveBackgroundSettings) , VectorImage.Resize(int, int, ResizeType) , VectorImage.Resize(int, int, ImageResizeSettings) , VectorImage.RotateFlip(RotateFlipType) , VectorImage.Crop(Rectangle) , VectorImage.Rotate(float) , VectorImage.SizeF , VectorImage.WidthF , VectorImage.HeightF , VectorImage.Width , VectorImage.Height , Image.CanLoad(string) , Image.CanLoad(string, LoadOptions) , Image.CanLoad(Stream) , Image.CanLoad(Stream, LoadOptions) , Image.Create(ImageOptionsBase, int, int) , Image.Create(Image[]) , Image.Create(MultipageCreateOptions) , Image.Create(string[], bool) , Image.Create(string[]) , Image.Create(Image[], bool) , Image.GetFileFormat(string) , Image.GetFileFormat(Stream) , Image.GetFittingRectangle(Rectangle, int, int) , Image.GetFittingRectangle(Rectangle, int[], int, int) , Image.Load(string, LoadOptions) , Image.Load(string) , Image.Load(Stream, LoadOptions) , Image.Load(Stream) , Image.GetProportionalWidth(int, int, int) , Image.GetProportionalHeight(int, int, int) , Image.RemoveMetadata() , Image.CanSave(ImageOptionsBase) , Image.Resize(int, int) , Image.Resize(int, int, ResizeType) , Image.Resize(int, int, ImageResizeSettings) , Image.GetDefaultOptions(object[]) , Image.GetOriginalOptions() , Image.ResizeWidthProportionally(int) , Image.ResizeHeightProportionally(int) , Image.ResizeWidthProportionally(int, ResizeType) , Image.ResizeHeightProportionally(int, ResizeType) , Image.ResizeWidthProportionally(int, ImageResizeSettings) , Image.ResizeHeightProportionally(int, ImageResizeSettings) , Image.RotateFlip(RotateFlipType) , Image.Rotate(float) , Image.Crop(Rectangle) , Image.Crop(int, int, int, int) , Image.Save() , Image.Save(string) , Image.Save(string, ImageOptionsBase) , Image.Save(string, ImageOptionsBase, Rectangle) , Image.Save(Stream, ImageOptionsBase) , Image.Save(Stream, ImageOptionsBase, Rectangle) , Image.GetSerializedStream(ImageOptionsBase, Rectangle, out int) , Image.SetPalette(IColorPalette, bool) , Image.BitsPerPixel , Image.Bounds , Image.Container , Image.Height , Image.Palette , Image.UsePalette , Image.Size , Image.Width , Image.InterruptMonitor , Image.BufferSizeHint , Image.AutoAdjustPalette , Image.HasBackgroundColor , Image.FileFormat , Image.BackgroundColor , DataStreamSupporter.CacheData() , DataStreamSupporter.Save() , DataStreamSupporter.Save(Stream) , DataStreamSupporter.Save(string) , DataStreamSupporter.Save(string, bool) , DataStreamSupporter.DataStreamContainer , DataStreamSupporter.IsCached , DisposableObject.Dispose() , DisposableObject.Disposed , object.GetType() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Examples

重新编辑 EPS 图像并将其导出到 PNG 格式。

// 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());
                                                        }

将 EPS 图像转换为 PDF 使用 PostScript 播放。

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);
                                                               }

将 EPS 图像转换为 PNG 使用 PostScript 播放。

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);
                                                               }

使用先进设置恢复 EPS 图像。

// 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());
                                                    }

Properties

BitsPerPixel

使用此属性轻松地访问图像的准确点深度。比特每像素计算,为图像的颜色深度提供关键的洞察力帮助优化处理任务 适合需要的应用程序精细控制图像操纵和分析。

public override int BitsPerPixel { get; }

财产价值

int

Exceptions

NotSupportedException

BoundingBox

通过在设备独立点访问原始边界框,此属性提供有关 Aspose.Imaging.FileFormats.Eps.EpsImage 的关键地质信息。通过获取这些数据,用户可以准确地评估图像的大小和外观。比例,方便精确的配置和定位在各种应用。

public RectangleF BoundingBox { get; }

财产价值

RectangleF

BoundingBoxPx

此属性将返回 Aspose.Imaging.FileFormats.Eps.EpsImage 的原始边缘框例如,在像素中提供必要的地质数据,以确保准确的传输和使用此信息,用户可以确保在他们的项目中准确地放置和大小 /// EPS 图像,提高整体视觉呈现和质量。

public Rectangle BoundingBoxPx { get; }

财产价值

Rectangle

CreationDate

EPS文档结构条约(DSC)的创建日期提交评论,本属性提供指示 EPS 文件的必需金属数据通过访问这些信息,用户获得文件的洞察力。起源和时间,增强文件管理和组织。

[JsonProperty]
public DateTime CreationDate { get; }

财产价值

DateTime

Creator

本属性提供从 EPS 文件中获取的创作者信息的访问结构化公约(DSC)评论在 EPS 文件中找到。创作者详细信息提供了解所使用的软件或工具EPS 文件,通过各种平台进行兼容性评估,并申请。

[JsonProperty]
public string Creator { get; }

财产价值

string

EpsType

访问和解释您的 EPS 图像的子类值,简化您的工作流和在平台上提高兼容性 理想的 EPS 优化在您的项目中以精确性和效率进行子类回收。

public EpsType EpsType { get; }

财产价值

EpsType

FileFormat

使用此属性访问您的图像的文件格式。关于您的图像文件格式的信息,方便兼容性和有效处理. 理想地识别图像文件的格式无缝融入您的项目。

public override FileFormat FileFormat { get; }

财产价值

FileFormat

HasRasterPreview

用此属性轻松地发现一个拉斯特预览的存在。该 boolean 值表示 Aspose.Imaging.FileFormats.Eps.EpsImage 示例是否包含raster preview,以清晰度和效率赋予您的图像处理任务。理想的工作流决策,基于工作流的存在或缺席。拉斯特预览在EPS图像中。

public bool HasRasterPreview { get; }

财产价值

bool

高F

使用此属性访问图像的高度 获取图像的高度方便,允许无缝的布局调整,方面比例计算,以及准确的通过不同的屏幕分辨率和显示环境进行播放。

public override float HeightF { get; }

财产价值

float

IsCached

此属性提供了一个方便的方式来检查对象的数据是否目前存在隐藏,消除需要额外的数据阅读。有效的方法,确定是否有必要的信息可用;优化性能,并在数据密集操作中减少资源过剩。

public override bool IsCached { get; }

财产价值

bool

PostScriptVersion

此属性收回与 PostScript 相关的版本Aspose.Imaging.FileFormats.Eps.EpsImage 例子. 它提供了对特定 PostScript 的洞察力在 EPS 文件中使用的语言版本,有助于兼容性评估并促进与 PostScript 兼容的环境无缝集成。

[JsonProperty]
public string PostScriptVersion { get; }

财产价值

string

PreviewImageCount

您可以轻松地访问预览图像的数量. 此属性允许您要轻松地获取与您的文件相关的预览图像的数量,能够有效管理和导航您的图像预览。优化您的工作流,并有效地组织您的图像资产。

public int PreviewImageCount { get; }

财产价值

int

PreviewImages

恢复与您的文件相关的预览图像. 此属性提供无缝访问预览图像的收集,使您能够有效地浏览并按需要管理它们. 理想的快速预览和选择正确的图像为您的项目。

public Image[] PreviewImages { get; }

财产价值

Image ( )

Title

此属性获取从 EPS 文件结构中提取的标题条约(DSC)评论包含在 EPS 文件中。关于 EPS 文件的内容的代码数据,协助文档组织和在兼容的软件应用中进行识别。

[JsonProperty]
public string Title { get; }

财产价值

string

WidthF

以此方便的属性恢复图像的宽度。无力扩展,方便精确的布局计算,规模操作,和尺寸相关的任务在您的应用程序内. 理想的确保准确在各种平台和设备上播放和显示图像。

public override float WidthF { get; }

财产价值

float

Methods

CacheData()

這種方法並不像目前的實施Aspose.Imaging.FileFormats.Eps.EpsImage 类不包含存储数据。执行任何行动,理解这种行为对开发人员工作至关重要使用 EPS 图像,确保资源管理效率和最佳性能在他们的申请中。

public override void CacheData()

~EpsImage()

protected ~EpsImage()

GetDefaultOptions(对象[])

修复默认选项,轻松地简化图像处理任务。预配置设置,以加快工作流,并确保一致的输出质量没有手动配置。

public override ImageOptionsBase GetDefaultOptions(object[] args)

Parameters

args object ( )

这些论点。

Returns

ImageOptionsBase

默认选项

GetPreviewImage(EpsPreviewFormat)

恢复现有预览图像在指定的 format’ orreturns null 如果没有找到。

public Image GetPreviewImage(EpsPreviewFormat format = EpsPreviewFormat.Default)

Parameters

format EpsPreviewFormat

EPS预览图像格式。

Returns

Image

现有预览图像或 .

Exceptions

ArgumentOutOfRangeException

GetPreviewImages()

访问与 Aspose.Imaging.FileFormats.Eps.EpsImage 所链接的预览图像,允许在应用中进行检查或使用的无缝接收。提供方便的访问预览图像,提高用户与用户的互动图像数据。

public IEnumerable<image/> GetPreviewImages()

Returns

IEnumerable < Image >

预览图像。

ReleaseManagedResources()

释放管理资源 确保没有未管理资源在这里释放,因为它们可能已经释放了。

protected override void ReleaseManagedResources()

SaveData(Stream)

保存数据。

protected override void SaveData(Stream stream)

Parameters

stream Stream

流来保存数据。

SetPalette(彩色 彩色 彩色)

定制图像板以实现独特的颜色图表,并提高视觉吸引力。为特定效果调整颜色,优化图像质量平台和设备方便。

public override void SetPalette(IColorPalette palette, bool updateColors)

Parameters

palette IColorPalette

要安排的板块。

updateColors bool

如果设置为“真实”颜色,将根据新板更新;否则颜色指数仍然不变. 请注意,如果某些指数没有相应的板输入,不变的指数可能会破坏上载的图像。

Exceptions

NotSupportedException

未支持 VectorImage

 中文