Class: QgsTransformEffect¶
- class qgis.core.QgsTransformEffect¶
Bases:
QgsPaintEffect
A paint effect which applies transformations (such as move, scale and rotate) to a picture.
New in version 2.9.
QgsTransformEffect() Constructor for QgsTransformEffect.
Methods
- param rect:
- rtype:
QgsTransformEffect
Creates a new
QgsTransformEffect
effect from a properties string map.- param context:
Draws the source QPicture onto the specified painter.
Applies a workaround to a QPainter to avoid an issue with incorrect scaling when drawing QPictures.
Returns the offset which should be used when drawing the source image on to a destination render context.
- rtype:
Dict[str, Any]
- param props:
Returns whether transform will be reflected along the x-axis
Returns whether transform will be reflected along the y-axis
Returns the transform rotation, in degrees clockwise.
Returns the x axis scaling factor.
Returns the y axis scaling factor.
Sets whether to reflect along the x-axis
Sets whether to reflect along the y-axis
Sets the transform
rotation
, in degrees clockwise.Sets the x axis scaling factor.
Sets the y axis scaling factor.
Sets the x axis shearing factor.
Sets the y axis shearing factor.
Sets the map unit scale used for the transform translation.
Sets the units used for the transform translation.
Sets the transform x translation.
Sets the transform y translation.
Returns the x axis shearing factor.
Returns the y axis shearing factor.
Returns the source QPicture.
Returns the source QPicture rendered to a new QImage.
Returns the map unit scale used for the transform translation.
Returns the units used for the transform translation.
Returns the transform x translation.
Returns the transform y translation.
- rtype:
str
- boundingRect(self, rect: QRectF, context: QgsRenderContext) QRectF ¶
- Parameters:
rect (QRectF) –
context (QgsRenderContext) –
- Return type:
QRectF
- clone(self) QgsTransformEffect ¶
- Return type:
- create(map: Dict[str, Any]) QgsPaintEffect ¶
Creates a new
QgsTransformEffect
effect from a properties string map.- Parameters:
map (Dict[str) – encoded properties string map
- Return type:
- Returns:
new QgsTransformEffect
- draw(self, context: QgsRenderContext)¶
- Parameters:
context (QgsRenderContext) –
- drawSource(self, painter: QPainter)¶
Draws the source QPicture onto the specified painter. Handles scaling of the picture to account for the destination painter’s DPI.
- Parameters:
painter – destination painter
See also
See also
- fixQPictureDpi(self, painter: QPainter)¶
Applies a workaround to a QPainter to avoid an issue with incorrect scaling when drawing QPictures. This may need to be called by derived classes prior to rendering results onto a painter.
- Parameters:
painter – destination painter
- imageOffset(self, context: QgsRenderContext) QPointF ¶
Returns the offset which should be used when drawing the source image on to a destination render context.
- Parameters:
context – destination render context
- Returns:
point offset for image top left corner
See also
- properties(self) Dict[str, Any] ¶
- Return type:
Dict[str, Any]
- readProperties(self, props: Dict[str, Any])¶
- Parameters:
props (Dict[str) –
- reflectX(self) bool ¶
Returns whether transform will be reflected along the x-axis
- Return type:
bool
- Returns:
True
if transform will reflect horizontally
See also
See also
- reflectY(self) bool ¶
Returns whether transform will be reflected along the y-axis
- Return type:
bool
- Returns:
True
if transform will reflect horizontally
See also
See also
- rotation(self) float ¶
Returns the transform rotation, in degrees clockwise.
See also
- Return type:
float
- scaleX(self) float ¶
Returns the x axis scaling factor.
- Return type:
float
- Returns:
x axis scaling factor, where 1.0 = no scaling
See also
See also
- scaleY(self) float ¶
Returns the y axis scaling factor.
- Return type:
float
- Returns:
y axis scaling factor, where 1.0 = no scaling
See also
See also
- setReflectX(self, reflectX: bool)¶
Sets whether to reflect along the x-axis
- Parameters:
reflectX (bool) –
True
to reflect horizontally
See also
See also
- setReflectY(self, reflectY: bool)¶
Sets whether to reflect along the y-axis
- Parameters:
reflectY (bool) –
True
to reflect horizontally
See also
See also
- setRotation(self, rotation: float)¶
Sets the transform
rotation
, in degrees clockwise.See also
- Parameters:
rotation (float) –
- setScaleX(self, scaleX: float)¶
Sets the x axis scaling factor.
- Parameters:
scaleX (float) – factor to scale x axis by, where 1.0 = no scaling
See also
See also
- setScaleY(self, scaleY: float)¶
Sets the y axis scaling factor.
- Parameters:
scaleY (float) – factor to scale y axis by, where 1.0 = no scaling
See also
- setShearX(self, shearX: float)¶
Sets the x axis shearing factor.
- Parameters:
shearX (float) – x axis shearing
See also
See also
- setShearY(self, shearY: float)¶
Sets the y axis shearing factor.
- Parameters:
shearY (float) – y axis shearing
See also
See also
- setTranslateMapUnitScale(self, scale: QgsMapUnitScale)¶
Sets the map unit scale used for the transform translation.
- Parameters:
scale (QgsMapUnitScale) – map unit scale for translation
See also
See also
See also
See also
- setTranslateUnit(self, unit: QgsUnitTypes.RenderUnit)¶
Sets the units used for the transform translation.
- Parameters:
unit (QgsUnitTypes.RenderUnit) – units for translation
See also
See also
See also
See also
- setTranslateX(self, translateX: float)¶
Sets the transform x translation.
- Parameters:
translateX (float) – distance to translate along the x axis
See also
See also
See also
See also
- setTranslateY(self, translateY: float)¶
Sets the transform y translation.
- Parameters:
translateY (float) – distance to translate along the y axis
See also
See also
See also
See also
- shearX(self) float ¶
Returns the x axis shearing factor.
- Return type:
float
- Returns:
x axis shearing
See also
See also
- shearY(self) float ¶
Returns the y axis shearing factor.
- Return type:
float
- Returns:
y axis shearing
See also
See also
- source(self) QPicture ¶
Returns the source QPicture. The
draw()
member can utilize this when drawing the effect.- Returns:
source QPicture
See also
See also
- sourceAsImage(self, context: QgsRenderContext) QImage ¶
Returns the source QPicture rendered to a new QImage. The
draw()
member can utilize this when drawing the effect. The image will be padded or cropped from the original source QPicture by the results of theboundingRect()
method. The result is cached to speed up subsequent calls to sourceAsImage.- Returns:
source QPicture rendered to an image
See also
See also
See also
See also
- translateMapUnitScale(self) QgsMapUnitScale ¶
Returns the map unit scale used for the transform translation.
- Return type:
- Returns:
map unit scale for translation
See also
See also
See also
See also
- translateUnit(self) QgsUnitTypes.RenderUnit ¶
Returns the units used for the transform translation.
- Return type:
- Returns:
units for translation
See also
See also
See also
See also
- translateX(self) float ¶
Returns the transform x translation.
- Return type:
float
- Returns:
X distance translated along the x axis
See also
See also
See also
See also
- translateY(self) float ¶
Returns the transform y translation.
- Return type:
float
- Returns:
Y distance translated along the y axis
See also
See also
See also
See also
- type(self) str ¶
- Return type:
str