Class: QgsDrawSourceEffect

class qgis.core.QgsDrawSourceEffect

Bases: 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.

Methods

blendMode

Returns the blend mode for the effect

boundingRect

clone

rtype

QgsDrawSourceEffect

create

Creates a new QgsDrawSource effect from a properties string map.

draw

param context

drawSource

fixQPictureDpi

imageOffset

opacity

Returns the opacity for the effect

properties

rtype

Dict[str, str]

readProperties

param props

setBlendMode

Sets the blend mode for the effect

setOpacity

Sets the opacity for the effect.

source

sourceAsImage

type

rtype

str

blendMode(self) → QPainter.CompositionMode

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()

boundingRect()
clone(self)QgsDrawSourceEffect
Return type

QgsDrawSourceEffect

create(map: Dict[str, str])QgsPaintEffect

Creates a new QgsDrawSource effect from a properties string map.

Parameters

map (Dict[str) – encoded properties string map

Return type

QgsPaintEffect

Returns

new QgsDrawSourceEffect

draw(self, context: QgsRenderContext)
Parameters

context (QgsRenderContext) –

drawSource()
fixQPictureDpi()
imageOffset()
opacity(self) → float

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()

properties(self) → Dict[str, str]
Return type

Dict[str, str]

readProperties(self, props: Dict[str, str])
Parameters

props (Dict[str) –

setBlendMode(self, mode: QPainter.CompositionMode)

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)

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()

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

str