上一话题

基本绘制范例

下一话题

同心圆范例

复合模式

Demonstrates how Composition Modes work in QPainter .

This demo shows some of the more advanced composition modes supported by Qt.

../_images/composition-demo.png

The two most common forms of composition are Source and SourceOver . Source is used to draw opaque objects onto a paint device. In this mode, each pixel in the source replaces the corresponding pixel in the destination. In SourceOver composition mode, the source object is transparent and is drawn on top of the destination.

In addition to these standard modes, Qt defines the complete set of composition modes as defined by X. Porter and Y. Duff. See the QPainter 文档编制了解细节。

范例工程 @ code.qt.io