Hello guys,<br><br>I'm developing a tool using the great qgis api, but i've got some problems to use some features, and after search a lot, I need your help. That are two issues.<br><br>1 - I need to make an animation mode for raster images. So first, I've tried to make a list with all raster images, and, using a QTimeLine, set them visible or not. but the comand <br>
QgsMapCanvasLayer(LayerSet.at(0)).SetVisible(FALSE); //Layerset is the MapCanvas LayerSet.<br>it didin't work. So, to make the animation possible, I've had to replace the current layerset of the mapcanvas, but this is too memory expensive. So why possibly this setVisible didn't work?<br>
<br><div style="text-align: left;">2 - I need to make a pixel color transparent. I've achieved that using the setNoDataValue, but what I really need is, instead of make the pixel completely transparent, a transparency of, for example 50%. I've also tried with this function:<br>
</div><br> QgsRasterTransparency::TransparentSingleValuePixel myTransparentPixel;<br> QList<QgsRasterTransparency::TransparentSingleValuePixel> myTransparentSingleValuePixelList;<br><br> myTransparentPixel.pixelValue = 0.0;<br>
myTransparentPixel.percentTransparent = 50.0;<br><br> myTransparentSingleValuePixelList.append( myTransparentPixel );<br> mRasterLayer->rasterTransparency()->setTransparentSingleValuePixelList( myTransparentSingleValuePixelList );<br>
m_qgsImage->refresh();<br><br>but, it also didn't work. <br><br>Any Ideas?<br><br clear="all">Best Regards,<br>------------------------------<br>Sérgio Cavalcante<br><br>
<br>