mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
Adjusted the advanced symbology so the gradients run diagonally bottom left to top right.
git-svn-id: http://svn.osgeo.org/qgis/trunk@447 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
4c201f2fa2
commit
ba77db4560
@ -439,15 +439,22 @@ void QgsRasterLayerProperties::makeScalePreview(QString theColor)
|
||||
myQImage.setPixel(myColInt,myRowInt,qRgb((unsigned int)myRedDouble, (unsigned int)myGreenDouble, (unsigned int)myBlueDouble));
|
||||
}
|
||||
}
|
||||
//now convert the qimage to a pixmap so we can set the pixmap label with it
|
||||
// Create a pixmap the same size as the image - to be placed in the pixmalLabel
|
||||
QPixmap *myQPixmap = new QPixmap(100,100);
|
||||
myQPixmap->convertFromImage(myQImage,36);
|
||||
|
||||
//
|
||||
// Draw a text alabel onto the pixmap showing the min max value
|
||||
//
|
||||
QPainter myQPainter(myQPixmap);
|
||||
myQPainter.rotate( -45 );
|
||||
myQPainter.drawImage(-70,0,myQImage.scale(140,140));
|
||||
myQPainter.rotate( 45 );
|
||||
QFont myQFont( "time", 18, QFont::Bold );
|
||||
myQPainter.setFont( myQFont );
|
||||
myQPainter.setPen( Qt::white );
|
||||
myQPainter.drawText(10,50, QString::number(static_cast<unsigned int>(myMinDouble)) + " - " + QString::number(static_cast<unsigned int>(myMaxDouble)) );
|
||||
myQPainter.drawText(15,50, QString::number(static_cast<unsigned int>(myMinDouble)) + " - " + QString::number(static_cast
|
||||
<unsigned int>(myMaxDouble)) );
|
||||
|
||||
//now draw the image into the relevant pixmap label
|
||||
if (theColor=="red")
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user