ImagesDifference
概述
ImagesDifference 是 Aspose.PDF FOSS 中用于 .NET 的类。继承自:IDisposable。
两页已渲染 PDF 的图形比较结果:第一(源)页被光栅化为 24bpp 位图,并记录每个像素与第二(目标)页的差异位置。
此类提供 3 种方法,用于在 .NET 程序中操作 ImagesDifference 对象。可用的方法包括:DifferenceToImage、Dispose、GetDestinationImage。在安装了 Aspose.PDF FOSS for .NET 包之后,所有公共成员对任何 .NET 应用程序均可访问。属性:Difference、Height、SourceImage、Stride。
属性
| 名称 | 类型 | 访问 | 描述 |
|---|---|---|---|
SourceImage | Bitmap | 读取 | 第一(源)页渲染为 24bpp RGB 位图。 |
Difference | int[] | 读取 | 每像素差异记录,行主序(index = y * Width + x)。 |
Stride | int | 读取 | 24bpp 下 SourceImage 的行跨度(字节)。 |
Height | int | 读取 | 比较图像的像素高度。 |
方法
| 签名 | 描述 |
|---|---|
GetDestinationImage() | 重建第二页(目标)图像:相同的像素从源复制,不同的像素采用其记录的目标颜色。 |
DifferenceToImage(color: Color, backgroundColor: Color) | 生成差异掩码:两页不同的地方使用颜色标记,相同的地方使用 backgroundColor。 |
Dispose() | 对该 ImagesDifference 实例调用 Dispose。 |