ImagesDifference

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。

属性

名称类型访问描述
SourceImageBitmap读取第一(源)页渲染为 24bpp RGB 位图。
Differenceint[]读取每像素差异记录,行主序(index = y * Width + x)。
Strideint读取24bpp 下 SourceImage 的行跨度(字节)。
Heightint读取比较图像的像素高度。

方法

签名描述
GetDestinationImage()重建第二页(目标)图像:相同的像素从源复制,不同的像素采用其记录的目标颜色。
DifferenceToImage(color: Color, backgroundColor: Color)生成差异掩码:两页不同的地方使用颜色标记,相同的地方使用 backgroundColor。
Dispose()对该 ImagesDifference 实例调用 Dispose。
 中文