Subgroup: other
Class: QgsGlowEffect¶
-
class
qgis.core.
QgsGlowEffect
¶ Bases:
qgis._core.QgsPaintEffect
Base class for paint effect which draw a glow inside or outside a picture.
New in version 2.9: Methods
begin
Begins intercepting paint operations to a render context. blendMode
Returns the blend mode for the effect blurLevel
Returns the blur level (strength) for the glow. boundingRect
clone
Duplicates an effect by creating a deep copy of the effect color
Returns the color for the glow. colorType
Returns the color mode used for the glow. draw
drawMode
Returns the draw mode for the effect. drawSource
enabled
Returns whether the effect is enabled end
Ends interception of paint operations to a render context, and draws the result to the render context after being modified by the effect. fixQPictureDpi
imageOffset
opacity
Returns the opacity for the effect. properties
ramp
Returns the color ramp used for the glow. readProperties
render
Renders a picture using the effect. saveProperties
Saves the current state of the effect to a DOM element. setBlendMode
Sets the blend mode for the effect setBlurLevel
Sets blur level (strength) for the glow. setColor
Sets the color for the glow. setColorType
Sets the color mode to use for the glow. setDrawMode
Sets the draw mode for the effect. setEnabled
Sets whether the effect is enabled setOpacity
Sets the opacity
for the effect.setRamp
Sets the color ramp for the glow. setSpread
Sets the spread distance for drawing the glow effect. setSpreadMapUnitScale
Sets the map unit scale used for the spread distance. setSpreadUnit
Sets the units used for the glow spread distance. shadeExterior
Specifies whether the glow is drawn outside the picture or within the picture. source
sourceAsImage
spread
Returns the spread distance used for drawing the glow effect. spreadMapUnitScale
Returns the map unit scale used for the spread distance. spreadUnit
Returns the units used for the glow spread distance. type
Returns the effect type. Attributes
ColorRamp
Modifier
ModifyAndRender
Render
SingleColor
-
ColorRamp
= 1¶
-
class
GlowColorType
¶ Bases:
int
-
SingleColor
= 0¶
-
blendMode
(self) → QPainter.CompositionMode¶ Returns the blend mode for the effect
Returns: blend mode used for drawing the effect on to a destination paint device
See also
-
blurLevel
(self) → int¶ Returns the blur level (strength) for the glow.
Returns: blur level. Value will be between 0 and 16, with larger values indicating greater blur strength.
See also
-
boundingRect
(self, rect: QRectF, context: QgsRenderContext) → QRectF¶
-
color
(self) → QColor¶ Returns the color for the glow. This only applies if the colorType() is set to SingleColor. The glow will fade between the specified color and a totally transparent version of the color.
Returns: glow color See also
See also
-
colorType
(self) → QgsGlowEffect.GlowColorType¶ Returns the color mode used for the glow. The glow can either be drawn using a
QgsColorRamp
color ramp or by specificing a single color.Returns: current color mode used for the glow See also
See also
See also
-
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
-
properties
(self) → Dict[str, str]¶
-
ramp
(self) → QgsColorRamp¶ Returns the color ramp used for the glow. This only applies if the colorType() is set to ColorRamp. The glow will utilize colors from the ramp.
Returns: color ramp for glow See also
See also
-
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 effect on to a destination paint device
See also
-
setBlurLevel
(self, level: int)¶ Sets blur level (strength) for the glow. This can be used to smooth the output from the glow effect.
Parameters: level – blur level. Values between 0 and 16 are valid, with larger values indicating greater blur strength.
See also
-
setColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the color for the glow. This only applies if the colorType() is set to SingleColor. The glow will fade between the specified color and a totally transparent version of the color.
Parameters: color – glow color See also
See also
-
setColorType
(self, colorType: QgsGlowEffect.GlowColorType)¶ Sets the color mode to use for the glow. The glow can either be drawn using a
QgsColorRamp
color ramp or by simply specificing a single color. setColorType is used to specify which mode to use for the glow.Parameters: colorType – color type to use for glow See also
See also
See also
-
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
-
setRamp
(self, ramp: QgsColorRamp)¶ Sets the color ramp for the glow. This only applies if the colorType() is set to ColorRamp. The glow will utilize colors from the ramp.
Parameters: ramp – color ramp for glow. Ownership of the ramp is transferred to the effect. See also
See also
-
setSpread
(self, spread: float)¶ Sets the spread distance for drawing the glow effect.
Parameters: spread – spread distance. Units are specified via setSpreadUnit() See also
See also
See also
-
setSpreadMapUnitScale
(self, scale: QgsMapUnitScale)¶ Sets the map unit scale used for the spread distance.
Parameters: scale – map unit scale for spread distance See also
See also
See also
-
setSpreadUnit
(self, unit: QgsUnitTypes.RenderUnit)¶ Sets the units used for the glow spread distance.
Parameters: unit – units for spread distance See also
See also
See also
-
shadeExterior
(self) → bool¶ Specifies whether the glow is drawn outside the picture or within the picture.
Returns: true if glow is to be drawn outside the picture, or false to draw glow within the picture
-
source
()¶
-
sourceAsImage
()¶
-
spread
(self) → float¶ Returns the spread distance used for drawing the glow effect.
Returns: spread distance. Units are retrieved via spreadUnit() See also
See also
See also
-
spreadMapUnitScale
(self) → QgsMapUnitScale¶ Returns the map unit scale used for the spread distance.
Returns: map unit scale for spread distance See also
See also
See also
-
spreadUnit
(self) → QgsUnitTypes.RenderUnit¶ Returns the units used for the glow spread distance.
Returns: units for spread distance See also
See also
See also
-