<div dir="ltr"><div><div>Hello,<br><br></div><div>Sorry if I repeat my question that I sent some time ago,  <span id="result_box" class="" lang="en"><span class="">but it seems</span> <span class="">very</span> <span class="">relevant to the topic.</span></span></div><div><br></div>I noticed that using  the    .render()    function  with  pyQgis > 2.2   the labels are not  visible.<br><br></div>This is my test source code (taken from my GEarthView plugin):<br><div><br><br>                iface = qgis.utils.iface<br><br>                mapRenderer = mapCanvas.mapRenderer()<br>                mapRect = mapRenderer.extent()<br>                width = mapRenderer.width()<br>                height = mapRenderer.height()<br>                srs = mapRenderer.destinationCrs()<br><br>                # create output image and initialize it<br>                image = QImage(QSize(width, height), QImage.Format_ARGB32)<br>                image.fill(0)<br>                <br>                #adjust map canvas (renderer) to the image size and render<br>                imagePainter = QPainter(image)<br>                <br>                zoom = 1<br>                target_dpi = int(round(zoom * mapRenderer.outputDpi()))                <br>                <br>                mapRenderer.setOutputSize(QSize(width, height), target_dpi)<br>            <br>                mapRenderer.render(imagePainter)<br>                imagePainter.end()<br><br>                xN = mapRect.xMinimum()<br>                yN = mapRect.yMinimum()<br><br>                nomePNG = ("TestImage")<br>                <br>                input_file = out_folder + "/" + nomePNG + ".png"<br>                <br>                image.save(input_file, "png")<br><br><br></div><div>So, my question is :  how need to change my code to have labels again visible ?<br><br>:)<br><br></div><div><br></div><div>Thank you for any link and answer<br><br></div>Roberto</div><div class="gmail_extra"><br><div class="gmail_quote">2014-10-05 22:18 GMT+02:00 Anita Graser <span dir="ltr"><<a href="mailto:anitagraser@gmx.at" target="_blank">anitagraser@gmx.at</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 05.10.2014, 18:54 Uhr, schrieb Larry Shaffer <<a href="mailto:larrys@dakotacarto.com" target="_blank">larrys@dakotacarto.com</a>>:<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Here's a small script you can use to test the Python bindings for labeling<br>
</blockquote>
<br></span>
Thanks a lot Larry! I'll give it a try!<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Feel free to add this to the Cookbook. However, the API for labeling may<br>
change during the 2.7 dev cycle, if rule- and style-based labeling is<br>
introduced.<br>
</blockquote>
<br></span>
You mean it will change without breaking it? ;-)<div class="HOEnZb"><div class="h5"><br>
<br>
Best wishes,<br>
Anita<br>
<br>
<br>
-- <br>
<a href="http://anitagraser.com" target="_blank">anitagraser.com</a><br>
______________________________<u></u>_________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-<u></u>developer</a><br>
</div></div></blockquote></div><br></div>