mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Changed n to black
git-svn-id: http://svn.osgeo.org/qgis/trunk@1323 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
parent
374d208934
commit
070c557dc7
@ -40,6 +40,7 @@ email : tim@linfiniti.com
|
|||||||
#include <qpainter.h>
|
#include <qpainter.h>
|
||||||
#include <qfont.h>
|
#include <qfont.h>
|
||||||
#include <qpicture.h>
|
#include <qpicture.h>
|
||||||
|
#include <qpointarray.h>
|
||||||
|
|
||||||
//non qt includes
|
//non qt includes
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -143,25 +144,33 @@ void Plugin::renderNorthArrow()
|
|||||||
//how much should the north arrow be rotated by?
|
//how much should the north arrow be rotated by?
|
||||||
int myRotationInt = 0;
|
int myRotationInt = 0;
|
||||||
//dir where north arrows live
|
//dir where north arrows live
|
||||||
//QString myDirString = QString(PKGDATAPATH)+"/svg/north_arrows/";
|
QString myDirString = QString(PKGDATAPATH)+"/svg/north_arrows/";
|
||||||
//pixmap containing map
|
//pixmap containing map
|
||||||
QPixmap * myQPixmap = qGisInterface->getMapCanvas()->canvasPixmap();
|
QPixmap * myQPixmap = qGisInterface->getMapCanvas()->canvasPixmap();
|
||||||
//paint device that we can draw our pixmap onto
|
//paint device that we can draw our pixmap onto
|
||||||
QPainter myQPainter(myQPixmap);
|
QPainter myQPainter(myQPixmap);
|
||||||
|
QPointArray myPointArray;
|
||||||
|
//save the current canvas rotation
|
||||||
|
myQPainter.save();
|
||||||
//rotate the canvas
|
//rotate the canvas
|
||||||
//myQPainter.rotate(-myRotationInt);
|
myQPainter.rotate( myRotationInt );
|
||||||
|
myPointArray.setPoints( 30,10, -10,-10 , 20,0 );
|
||||||
|
//myQPainter.drawPolygon( myPointArray );
|
||||||
|
|
||||||
|
//QPicture myQPicture;
|
||||||
|
//myQPicture.load(myDirString+QString("/default.svg"));
|
||||||
|
//myQPainter.drawPicture(140,140,myQPicture);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QPicture myQPicture;
|
|
||||||
myQPicture.load(QString("/home/aps02ts/share/qgis/svg/north_arrows/Default.svg"));
|
|
||||||
myQPainter.drawPicture(140,140,myQPicture);
|
|
||||||
|
|
||||||
/* This is how you write some text to the qpainter */
|
/* This is how you write some text to the qpainter */
|
||||||
QFont myQFont("time", 24, QFont::Bold);
|
QFont myQFont("time", 24, QFont::Bold);
|
||||||
myQPainter.setFont(myQFont);
|
myQPainter.setFont(myQFont);
|
||||||
myQPainter.setPen(Qt::white);
|
myQPainter.setPen(Qt::black);
|
||||||
myQPainter.drawText(15, 50, QString("N"));
|
myQPainter.drawText(15, 50, QString("N"));
|
||||||
/* */
|
//unrotate the canvase again
|
||||||
//myQPainter.rotate(myRotationInt);
|
myQPainter.restore();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unload the plugin by cleaning up the GUI
|
// Unload the plugin by cleaning up the GUI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user