Class: QgsAnnotationPictureItem

An annotation item which renders a picture.

Added in version 3.40.

List of all members, including inherited members

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.

Constructor

__init__

Methods

format

Returns the picture format.

lockAspectRatio

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

path

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

setLockAspectRatio

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

setPath

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

Virtual Methods

In PyQGIS, only methods marked as virtual can be safely overridden in a Python subclass of QgsAnnotationPictureItem. See the FAQ for more details.

clone

Static Methods

create

Creates a new polygon annotation item.

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:
virtual clone(self) → QgsAnnotationPictureItem | None[source]
Return type:

QgsAnnotationPictureItem|None

static create() → QgsAnnotationPictureItem | None[source]

Creates a new polygon annotation item.

Return type:

QgsAnnotationPictureItem|None

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: