@@ -1586,8 +1586,9 @@ void QgsRasterLayer::drawSingleBandGray(QPainter * theQPainter, QgsRasterViewPor
1586
1586
void *myGdalScanData = readData ( myGdalBand, theRasterViewPort );
1587
1587
1588
1588
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
1589
- myQImage.fill (0 );
1589
+ // myQImage.fill(0);
1590
1590
myQImage.setAlphaBuffer (true );
1591
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
1591
1592
1592
1593
double myRangeDouble = myRasterBandStats.rangeDouble ;
1593
1594
@@ -1675,8 +1676,9 @@ void QgsRasterLayer::drawSingleBandPseudoColor(QPainter * theQPainter,
1675
1676
void *myGdalScanData = readData ( myGdalBand, theRasterViewPort );
1676
1677
1677
1678
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
1678
- myQImage.fill (0 );
1679
+ // myQImage.fill(0);
1679
1680
myQImage.setAlphaBuffer (true );
1681
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
1680
1682
1681
1683
// calculate the adjusted matrix stats - which come into affect if the user has chosen
1682
1684
QgsRasterBandStats myAdjustedRasterBandStats = getRasterBandStats (theBandNoInt);
@@ -1897,8 +1899,9 @@ void QgsRasterLayer::drawPalettedSingleBandColor(QPainter * theQPainter, QgsRast
1897
1899
QgsColorTable *myColorTable = colorTable ( theBandNoInt );
1898
1900
1899
1901
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
1900
- myQImage.fill (0 );
1902
+ // myQImage.fill(0);
1901
1903
myQImage.setAlphaBuffer (true );
1904
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
1902
1905
1903
1906
for (int myColumnInt = 0 ; myColumnInt < theRasterViewPort->drawableAreaYDimInt ; ++myColumnInt)
1904
1907
{
@@ -1989,8 +1992,9 @@ void QgsRasterLayer::drawPalettedSingleBandGray(QPainter * theQPainter, QgsRaste
1989
1992
QgsColorTable *myColorTable = &(myRasterBandStats.colorTable );
1990
1993
1991
1994
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
1992
- myQImage.fill (0 );
1995
+ // myQImage.fill(0);
1993
1996
myQImage.setAlphaBuffer (true );
1997
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
1994
1998
1995
1999
for (int myColumnInt = 0 ; myColumnInt < theRasterViewPort->drawableAreaYDimInt ; ++myColumnInt)
1996
2000
{
@@ -2096,8 +2100,9 @@ void QgsRasterLayer::drawPalettedSingleBandPseudoColor(QPainter * theQPainter, Q
2096
2100
QgsColorTable *myColorTable = &(myRasterBandStats.colorTable );
2097
2101
2098
2102
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
2099
- myQImage.fill (0 );
2103
+ // myQImage.fill(0);
2100
2104
myQImage.setAlphaBuffer (true );
2105
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
2101
2106
2102
2107
int myRedInt = 0 ;
2103
2108
int myGreenInt = 0 ;
@@ -2335,8 +2340,9 @@ void QgsRasterLayer::drawPalettedMultiBandColor(QPainter * theQPainter, QgsRaste
2335
2340
QgsColorTable *myColorTable = colorTable ( theBandNoInt );
2336
2341
2337
2342
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
2338
- myQImage.fill (0 );
2343
+ // myQImage.fill(0);
2339
2344
myQImage.setAlphaBuffer (true );
2345
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
2340
2346
2341
2347
for (int myColumnInt = 0 ; myColumnInt < theRasterViewPort->drawableAreaYDimInt ; ++myColumnInt)
2342
2348
{
@@ -2473,8 +2479,9 @@ void QgsRasterLayer::drawMultiBandColor(QPainter * theQPainter, QgsRasterViewPor
2473
2479
void *myGdalBlueData = readData ( myGdalBlueBand, theRasterViewPort );
2474
2480
2475
2481
QImage myQImage = QImage (theRasterViewPort->drawableAreaXDimInt , theRasterViewPort->drawableAreaYDimInt , 32 );
2476
- myQImage.fill (0 );
2482
+ // myQImage.fill(0);
2477
2483
myQImage.setAlphaBuffer (true );
2484
+ myQImage.fill (qRgba (255 ,255 ,255 ,0 )); // fill transparent
2478
2485
for (int myColumnInt = 0 ; myColumnInt < theRasterViewPort->drawableAreaYDimInt ; ++myColumnInt)
2479
2486
{
2480
2487
for (int myRowInt = 0 ; myRowInt < theRasterViewPort->drawableAreaXDimInt ; ++myRowInt)
0 commit comments