ImageInfo
ImageInfo
概述
ImageInfo 是 Aspose.PDF 为 Go 提供的 FOSS 中的类型。
ImageInfo 保存页面上发现的图像的元数据,而不对像素数据进行解码。
此类型为在 Go 程序中处理 ImageInfo 对象提供了 4 个方法。可用的方法包括:Extract、Remove、Replace、ReplaceFromStream。在安装 Aspose.PDF FOSS for Go 包后,所有公共成员对任何 Go 应用程序均可访问。属性包括:BPC、ColorSpace、Format、Height、Inline、Name,以及另外 5 项。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
Width | int | 读写 | 获取宽度。 |
Height | int | 读写 | 获取高度。 |
BPC | int | 读写 | 获取 bpc。 |
ColorSpace | ImageColorSpace | 读写 | 获取颜色空间。 |
Format | ImageFormat | 读写 | 获取格式。 |
X | float64 | 读写 | 获取 x。 |
Y | float64 | 读写 | 获取 y。 |
PageWidth | float64 | 读写 | 获取页面宽度。 |
PageHeight | float64 | 读写 | 获取页面高度。 |
Inline | bool | 读写 | 获取内联。 |
Name | string | 读写 | 获取名称。 |
方法
| 签名 | 描述 |
|---|---|
Extract() → (*Image, error) | Extract 对图像进行解码,并返回包含像素数据的完整 Image。 |
Remove() → error | Remove 将图像从页面中移除。 |
Replace(path: string) → error | Replace 将图像数据替换为来自文件的新图像。 |
ReplaceFromStream(r: io.Reader) → error | ReplaceFromStream 将图像数据替换为来自读取器的新图像。 |