<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 16, 2014 at 6:01 PM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@keybit.net" target="_blank">strk@keybit.net</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">According to documentation for the QgsRasterLayer class [1], a raster<br>
layer can export its legend as a pixmap using a legendPixmap() method,<br>
but the code doesn't not contain any such virtual method.<br>
<br>
[1] <a href="http://qgis.org/api/classQgsRasterLayer.html" target="_blank">http://qgis.org/api/classQgsRasterLayer.html</a><br>
<br>
Instead, the class has a (non-virtual) method to retrieve a legend<br>
in form of a list of name/color pairs.<br>
<br>
A pure image legend is not accounted for in the raster interface<br>
anymore.  Still, beside the documentation, there's also a LegendUrl<br>
property under the "Metadata" tab of raster layer properties, which<br>
does not seem to be used at all either.<br></blockquote><div><br></div><div>Looks like an ancient artifact in the API documentation. I would guess such method was removed even before QGIS 1.0)</div><div> </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is there a plan to allow raster layers to expose their layer again<br>
as an image ?<br></blockquote><div><br></div><div>No. If someone wants legend image for a layer (or more of them), there is now QgsLegendRenderer class for rendering it.</div><div><br></div><div>Martin</div><div><br></div></div></div></div>