Skip to content

Commit

Permalink
Transparency for WMS rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jun 25, 2012
1 parent d9f3ac8 commit 7cec992
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/core/raster/qgssinglebandcolordatarenderer.cpp
Expand Up @@ -84,10 +84,12 @@ void QgsSingleBandColorDataRenderer::draw( QPainter* p, QgsRasterViewPort* viewP
else
{
QRgb pixelColor;
double alpha = 255.0;
for ( int j = 0; j < nRasterCols; ++j )
{
QRgb c((( uint* )( rasterData ) )[currentRasterPos] );
pixelColor = qRgba( qRed( c ), qGreen( c ), qBlue( c ), 255 );
alpha = qAlpha( c );
pixelColor = qRgba( qRed( c ), qGreen( c ), qBlue( c ), mOpacity * alpha );
memcpy( &( scanLine[j*4] ), &pixelColor, 4 );
++currentRasterPos;
}
Expand Down

0 comments on commit 7cec992

Please sign in to comment.