[Qt-interest] pixmap.scaled gives empty pixmap

Matthias Pospiech matthias.pospiech at gmx.de
Wed Jul 21 10:56:20 CEST 2010


If I change in the following code the painter scale to the 
pixmap.scaled, the I get no output in my widget.

void QCameraImageBase::paintEvent(QPaintEvent * event)
{
    QPainter painter(this);
    painter.scale(scaleFracX, scaleFracY);
    //d->pixmap = d->pixmap.scaled(scaleFracX, scaleFracY, d->aspectRatio);
    painter.drawPixmap(0, 0, d->pixmap);
}

Why? I am interested in pixmap.scaled only because of the possibility to 
keep the aspect ratio, which I otherwise would have to programm on my own.

Matthias



More information about the Qt-interest-old mailing list