procedure DrawTranImage(DestCanvas: TCanvas; LeftPos: Integer; TopPos: Integer;
SourceImg: TBitmap; MaskImg: TBitmap); //绘制透明图像
var
OldCopyMode : LongInt; //原来的CopyMode设置值
begin
//DestCanvas:目标画布 SourceImg:原始图像 MaskImg:和原始图像配套的掩模
with DestCanvas do
begin
OldCopyMode := CopyMode; //保存原始的CopyMode设置
CopyMode := cmSrcAnd ; //将复制模式改为AND
Draw(LeftPos,TopPos,MaskImg); //绘制遮罩
CopyMode := cmSrcPaint; //将复制模式改为OR
Draw(LeftPos,TopPos,SourceImg); //绘制图象
CopyMode := OldCopyMode; //恢复原始的CopyMode设置
end;
end;
图像叠加
最新推荐文章于 2024-05-16 14:54:02 发布