Skip to content
Permalink
Browse files

Draw to QImage instead of QPixmap. When rendering is done, it's conve…

…rted

to QPixmap for fast onscreen drawing.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5063 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder
wonder committed Mar 19, 2006
1 parent 7c9442a commit d0943b807e0156bfb2a04b9f5ae2c11a6bce4d8e
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/gui/qgsmapcanvasmap.cpp
@@ -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 d0943b8

Please sign in to comment.
You can’t perform that action at this time.