Class: QgsAnnotationPictureItem

An annotation item which renders a picture.

Added in version 3.40.

Class Hierarchy

Inheritance diagram of qgis.core.QgsAnnotationPictureItem

Base classes

QgsAnnotationRectItem

Abstract base class for annotation items which render annotations in a rectangular shape.

QgsAnnotationItem

Abstract base class for annotation items which are drawn with QgsAnnotationLayers.

class qgis.core.QgsAnnotationPictureItem[source]

Bases: QgsAnnotationRectItem

__init__(format: Qgis.PictureFormat, path: str | None, bounds: QgsRectangle)

Constructor for QgsAnnotationPictureItem, rendering the specified image path within the specified bounds geometry.

Parameters:
static create() QgsAnnotationPictureItem | None[source]

Creates a new polygon annotation item.

Return type:

Optional[QgsAnnotationPictureItem]

format(self) Qgis.PictureFormat[source]

Returns the picture format.

Return type:

Qgis.PictureFormat

lockAspectRatio(self) bool[source]

Returns True if the aspect ratio of the picture will be retained.

Return type:

bool

path(self) str[source]

Returns the path of the image used to render the item.

See also

setPath()

Return type:

str

setLockAspectRatio(self, locked: bool)[source]

Sets whether the aspect ratio of the picture will be retained.

Parameters:

locked (bool)

setPath(self, format: Qgis.PictureFormat, path: str | None)[source]

Sets the format and path of the image used to render the item.

See also

path()

See also

format()

Parameters: