Class: QgsDrawSourceEffect

A paint effect which draws the source picture with minor or no alterations.

The draw source effect can be used to draw an unaltered copy of the original source picture. Minor changes like lowering the opacity and applying a blend mode are supported, however these changes will force the resultant output to be rasterized. If no alterations are performed then the original picture will be rendered as a vector.

Class Hierarchy

Inheritance diagram of qgis.core.QgsDrawSourceEffect

Base classes

QgsPaintEffect

Base class for visual effects which can be applied to QPicture drawings.

class qgis.core.QgsDrawSourceEffect[source]

Bases: QgsPaintEffect

blendMode(self) QPainter.CompositionMode[source]

Returns the blend mode for the effect

Return type:

QPainter.CompositionMode

Returns:

blend mode used for drawing the source on to a destination paint device

See also

setBlendMode()

static create(map: Dict[str, Any]) QgsPaintEffect | None[source]

Creates a new QgsDrawSource effect from a properties string map.

Parameters:

map (Dict[str, Any]) – encoded properties string map

Return type:

Optional[QgsPaintEffect]

Returns:

new QgsDrawSourceEffect

opacity(self) float[source]

Returns the opacity for the effect

Return type:

float

Returns:

opacity value between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque

See also

setOpacity()

setBlendMode(self, mode: QPainter.CompositionMode)[source]

Sets the blend mode for the effect

Parameters:

mode (QPainter.CompositionMode) – blend mode used for drawing the source on to a destination paint device

See also

blendMode()

setOpacity(self, opacity: float)[source]

Sets the opacity for the effect.

Parameters:

opacity (float) – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque

See also

opacity()