[Qgis-developer] Raster Transparency

sergio cavalcante sergio.cavalcante at gmail.com
Tue Aug 18 18:25:17 EDT 2009


Hello Tim,
Thank's for your reply.

Sadly, no difference. Any other ideas?

Best regards,
------------------------------
Sérgio Cavalcante



On Tue, Aug 18, 2009 at 6:29 PM, Tim Sutton <lists at linfiniti.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi
>
>
>
> sergio cavalcante wrote:
> > People, can anyone give me a little help with my transparency function?
> > Here is it:
> >
> > void CViewPort::SetRasterTransparent(QgsRasterLayer * mRasterLayer)
> >
> > {
> >
> >   double myTransparentValue;
> >
> >   double myPercentTransparent;
> >
> >
> >   QgsRasterTransparency::TransparentSingleValuePixel myTransparentPixel;
> >
> >   QList<QgsRasterTransparency::TransparentSingleValuePixel>
> > myTransparentSingleValuePixelList;
> >
> >
> >   myTransparentPixel.pixelValue = 0.00;
> >
> >   myTransparentPixel.percentTransparent = 100.00;
> >
> >   myTransparentSingleValuePixelList.append( myTransparentPixel );
> >
> >
> >   myTransparentPixel.pixelValue = 65.00;
> >
> >   myTransparentPixel.percentTransparent = 100.00;
> >
> >   myTransparentSingleValuePixelList.append( myTransparentPixel );
> >
> >
> >   mRasterLayer->rasterTransparency()->setTransparentSingleValuePixelList(
> > myTransparentSingleValuePixelList );
> >
> > }
> >
> > The pixels I need to become transparent are the 0 and 65. I put the same
> > values on the quantum gis application transparent pixel list and they
> become
> > transparent, but I couldn't get the same result in my app.
>
> Does calling:
>
>  mRasterLayer->triggerRepaint();
>
> at the end make any difference?
>
> Regards
>
> - --
>
> Tim Sutton - QGIS Project Steering Committee Member (Release  Manager)
> ==============================================
> Please do not email me off-list with technical
> support questions. Using the lists will gain
> more exposure for your issues and the knowledge
> surrounding your issue will be shared with all.
>
> Visit http://linfiniti.com to find out about:
>  * QGIS programming and support services
>  * Mapserver and PostGIS based hosting plans
>  * FOSS Consulting Services
> Skype: timlinux
> Irc: timlinux on #qgis at freenode.net
> ==============================================
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkqLHTAACgkQqk07qZdiYjdATACfVDRkxiODPGBiaLNsqeqNV0PC
> Xo0AniB2GQRY+wzpW7ZOyAQXRzq1XHAH
> =pS5H
> -----END PGP SIGNATURE-----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20090818/62cf1547/attachment.html


More information about the Qgis-developer mailing list