SetImageMask
影像處理、頁面版面
描述
設定所選影像的遮罩,可用來在以 DrawImage 或 DrawScaledImage 函式繪製時讓影像局部透明
指定的顏色範圍會變成透明。對 BMP、TIFF 這類無損壓縮影像效果最好
JPEG 影像採有損壓縮,影像遮罩可能造成光暈效應
顏色參數值域為 0 到 1,0 代表 0%、1 代表 100%。單色影像只會使用紅色成分
語法
Delphi
Function TPDFlib.SetImageMask(FromRed, FromGreen, FromBlue, ToRed, ToGreen, ToBlue: Double): Integer;
ActiveX
Function PDFlib::SetImageMask(FromRed As Double, FromGreen As Double, FromBlue As Double, ToRed As Double, ToGreen As Double, ToBlue As Double) As Long
DLL
int DLSetImageMask(int InstanceID, double FromRed, double FromGreen, double FromBlue, double ToRed, double ToGreen, double ToBlue);
參數
| FromRed | 遮罩起始顏色的紅成分 |
|---|---|
| FromGreen | 遮罩起始顏色的綠成分 |
| FromBlue | 遮罩起始顏色的藍成分 |
| ToRed | 遮罩結束顏色的紅成分 |
| ToGreen | 遮罩結束顏色的綠成分 |
| ToBlue | 遮罩結束顏色的藍成分 |
傳回值
| 0 | No image was selected |
|---|---|
| 1 | 影像遮罩設定成功 |