|
THotPDF.AddImageWithSMask
|
顶部 上一页 下一页 |
添加一个彩色图像 XObject,同时添加一个 PDF 1.4 soft-mask 图像 XObject(ISO 32000-1 8.9.5.4),使最终图片携带完整的逐像素透明度,而不是旧式
Delphi 语法: function AddImageWithSMask(Width, Height: Integer; const RGB: array of Byte; const Alpha: array of Byte): Integer; function AddImageWithTransparency(Width, Height: Integer; const RGB: array of Byte; const Alpha: array of Byte): Integer; function AddImageWithSMask32(Width, Height: Integer; const Pixels: array of Byte): Integer; function AddImageWithTransparency32(Width, Height: Integer; const Pixels: array of Byte): Integer;
C++ 语法: int AddImageWithSMask(int Width, int Height, const TBytes& RGB, const TBytes& Alpha); int AddImageWithTransparency(int Width, int Height, const TBytes& RGB, const TBytes& Alpha); int AddImageWithSMask32(int Width, int Height, const TBytes& Pixels); int AddImageWithTransparency32(int Width, int Height, const TBytes& Pixels);
说明 SMask 图像携带独立的 8 位 DeviceGray 通道,其亮度在绘制时驱动彩色图像的 alpha(0 = 全透明,255 = 不透明)。HotPDF 把两个平面都输出为 Flate 压缩的 image XObject,把彩色图像字典的 AddImageWithTransparency 与 AddImageWithTransparency32 是同一 PDF 1.4 软蒙版工作流的命名别名,供以“透明图像”而非 PDF 字典术语思考的调用点使用
AddImageWithSMask(Width, Height, RGB, Alpha) - - -
AddImageWithSMask32(Width, Height, Pixels) 面向打包 32 位 RGBA 输入的便捷重载。
返回值: 指向
代码示例
另请参阅 AddImage, THPDFPage.ShowImage, Version, PDF 过滤器支持
|