[QGIS-Developer] Exporting point symbols from processing algorithm

C Hamilton adenaculture at gmail.com
Thu Aug 13 11:40:32 PDT 2020


I am trying to figure out how to get the proper size to export a point
icon. From a processing algorithm that accepts a vector point layer I have
been able to get the renderer and each symbol.

rnd = layer.renderer()
symbol = rnd.symbol()

The symbol size as listed in the symbology size is

size = symbol.size()

Then I can export the symbol image with.

symbol.exportImage(path,"png", QSize(icon_size, icon_size))

How do I figure out what size QSize needs to be to properly draw the icon?
I am guessing that since the size is in mm or some other unit, there needs
to be a conversion from the symbol size to the icon size. How do I make
that conversion?

Thanks,

Calvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20200813/59c9f22b/attachment.html>


More information about the QGIS-Developer mailing list