38 if ( !p || !mIterator || !viewPort || !theQgsMapToPixel )
60 &block, topLeftCol, topLeftRow ) )
68 QImage img = block->
image();
72 QPrinter *printer =
dynamic_cast<QPrinter *
>( p->device() );
73 if ( printer && printer->outputFormat() == QPrinter::PdfFormat )
77 img = img.convertToFormat( QImage::Format_ARGB32 );
78 QRgb transparentBlack = qRgba( 0, 0, 0, 0 );
79 QRgb transparentWhite = qRgba( 255, 255, 255, 0 );
80 for (
int x = 0; x < img.width(); x++ )
82 for (
int y = 0; y < img.height(); y++ )
84 if ( img.pixel( x, y ) == transparentBlack )
86 img.setPixel( x, y, transparentWhite );
92 drawImage( p, viewPort, img, topLeftCol, topLeftRow, theQgsMapToPixel );
100 if ( !p || !viewPort )
108 p->setRenderHint( QPainter::Antialiasing,
false );
113 p->setBrush( QBrush( QColor( Qt::white ), Qt::NoBrush ) );
115 if ( theQgsMapToPixel )
117 int w = theQgsMapToPixel->
mapWidth();
126 p->translate( cx, cy );
127 p->rotate( rotation );
128 p->translate( -cx, -cy );
132 p->drawImage( tlPoint, img );
136 QRectF br = QRectF( tlPoint, img.size() );
137 QPointF c = br.center();
138 double rad =
std::max( br.width(), br.height() ) / 10;
139 p->drawRoundedRect( br, rad, rad );
140 p->drawLine( QLineF( br.x(), br.y(), br.x() + br.width(), br.y() + br.height() ) );
141 p->drawLine( QLineF( br.x() + br.width(), br.y(), br.x(), br.y() + br.height() ) );
143 double nw = br.width() * 0.5;
double nh = br.height() * 0.5;
144 br = QRectF( c - QPointF( nw / 2, nh / 2 ), QSize( nw, nh ) );
145 p->drawRoundedRect( br, rad, rad );
147 nw = br.width() * 0.5; nh = br.height() * 0.5;
148 br = QRectF( c - QPointF( nw / 2, nh / 2 ), QSize( nw, nh ) );
149 p->drawRoundedRect( br, rad, rad );