<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">But there is
</span><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">markerOffset2 and/or markerOffsetWithWidthAndHeight, maybe this does what you want? </span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><br>
</span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);"><a href="https://qgis.org/pyqgis/master/core/QgsSvgMarkerSymbolLayer.html">https://qgis.org/pyqgis/master/core/QgsSvgMarkerSymbolLayer.html</a></span></div>
<div class="elementToProof"><br>
</div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">HTH,</span></div>
<div class="elementToProof"><span style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">Frank</span></div>
<div id="appendonsend"></div>
<div class="elementToProof" style="font-family: "Century Gothic", sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display: inline-block; width: 98%;">
<div dir="ltr" id="divRplyFwdMsg"><span style="font-family: Calibri, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);"><b>Von:</b> QGIS-User <qgis-user-bounces@lists.osgeo.org> im Auftrag von Bernhard Seckinger via QGIS-User <qgis-user@lists.osgeo.org><br>
<b>Gesendet:</b> Donnerstag, 25. Januar 2024 10:03<br>
<b>An:</b> qgis-user@lists.osgeo.org <qgis-user@lists.osgeo.org><br>
<b>Betreff:</b> [Qgis-user] adding offset to QgsSvgMarkerSymbolLayer using pyqgis</span>
<div> </div>
</div>
<div><span style="font-size: 11pt;">Hi,<br>
<br>
I wrote a plugin which changes the symbology of a layer using SVG-images.<br>
Almost everything works but I need to add an offset to the SVG-image and did<br>
not find a way to set it from pyqgis.<br>
<br>
That's what I'm doing currently (rule is a rule from a QgsRuleBasedRenderer):<br>
<br>
icon = os.path.dirname(__file__) + 'a.svg';<br>
marker = QgsSvgMarkerSymbolLayer(icon)<br>
marker.setAngle(100) # setting the angle works<br>
# marker.setOffset(5,5) # this doesn't work (there is no setOffset method)<br>
rule.symbol().changeSymbolLayer(0,marker)<br>
<br>
Any ideas?<br>
<br>
Thanks, Bernhard<br>
<br>
--<br>
Bernhard Seckinger <bernhard.seckinger@bueffee.de><br>
_______________________________________________<br>
QGIS-User mailing list<br>
QGIS-User@lists.osgeo.org<br>
List info: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" id="OWAfc8e5eff-4802-69fa-7c4f-95ce2e3b4b72" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a href="https://lists.osgeo.org/mailman/listinfo/qgis-user" id="OWA73949305-1c50-6897-0d28-80c16dd3812e" class="OWAAutoLink" data-auth="NotApplicable" data-loopstyle="linkonly">
https://lists.osgeo.org/mailman/listinfo/qgis-user</a></span></div>
</body>
</html>