Skip to content

Commit

Permalink
Draw to QImage instead of QPixmap. When rendering is done, it's conve…
Browse files Browse the repository at this point in the history
…rted

to QPixmap for fast onscreen drawing.


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5063 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed Mar 19, 2006
1 parent b1995af commit 936b12c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/gui/qgsmapcanvasmap.cpp
Expand Up @@ -42,14 +42,22 @@ void QgsMapCanvasMap::resize(QSize size)

void QgsMapCanvasMap::render()
{
mPixmap.fill(mBgColor);
// use temporary image for rendering
QImage image(size(), QImage::Format_RGB32);

QPainter paint(&mPixmap);
image.fill(mBgColor.rgb());

QPainter paint;
paint.begin(&image);

// antialiasing
if (mAntiAliasing)
paint.setRenderHint(QPainter::Antialiasing);

mRender->render(&paint);

paint.end();

// convert QImage to QPixmap to acheive faster drawing on screen
mPixmap = QPixmap::fromImage(image);
}

0 comments on commit 936b12c

Please sign in to comment.