Class: QgsDrawSourceEffect

class qgis.core.QgsDrawSourceEffect

Bases: qgis._core.QgsPaintEffect

Constructor for QgsDrawSourceEffect

QgsDrawSourceEffect(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.

New in version 2.9: Enums

Methods

blendMode Returns the blend mode for the effect
boundingRect
clone
create Creates a new QgsDrawSource effect from a properties string map.
draw
drawSource
fixQPictureDpi
imageOffset
opacity Returns the opacity for the effect
properties
readProperties
setBlendMode Sets the blend mode for the effect
setOpacity Sets the opacity for the effect.
source
sourceAsImage
type

Signals

Attributes

blendMode(self) → QPainter.CompositionMode

Returns the blend mode for the effect

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

See also

setBlendMode()

boundingRect()
clone(self) → QgsDrawSourceEffect
create(map: Dict[str, str]) → QgsPaintEffect

Creates a new QgsDrawSource effect from a properties string map.

Parameters:map – encoded properties string map
Returns:new QgsDrawSourceEffect
draw(self, context: QgsRenderContext)
drawSource()
fixQPictureDpi()
imageOffset()
opacity(self) → float

Returns the opacity for the effect

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

See also

setOpacity()

properties(self) → Dict[str, str]
readProperties(self, props: Dict[str, str])
setBlendMode(self, mode: QPainter.CompositionMode)

Sets the blend mode for the effect

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

See also

blendMode()

setOpacity(self, opacity: float)

Sets the opacity for the effect.

Parameters:opacity – double between 0 and 1 inclusive, where 0 is fully transparent and 1 is fully opaque

See also

opacity()

source()
sourceAsImage()
type(self) → str