组合模式

演示QPainter 中合成模式的工作原理。

一款可对图像图层应用合成模式的应用程序

最常见的两种合成模式是“源”(Source)和“源覆盖”(SourceOver)。“源”模式用于将不透明对象绘制到绘图设备上。在此模式下,源对象中的每个像素都会替换目标对象中的对应像素。在“源覆盖”合成模式下,源对象是透明的,并绘制在目标对象之上。

除了这些标准模式外,Qt 还定义了由 T. Porter 和 T. Duff 所定义的完整合成模式集。详情请参阅QPainter 文档。

示例项目 @ code.qt.io

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.