All pastes #993084 Raw Edit

Untitled

public text v1 · immutable
#993084 ·published 2008-04-22 10:44 UTC
rendered paste body
void MythImage::Reflection()
{
    QSize newsize(width(), height()*2);

    QImage alphaChannel(size(), QImage::Format_RGB32);

    MakeGradient(alphaChannel, QColor("#AAAAAA"), QColor("#000000"), 200);

    QImage mirrorImage = mirrored();

    mirrorImage.setAlphaChannel(alphaChannel);

    QImage temp(newsize, QImage::Format_RGB32);

    QPainter newpainter(&temp);
    newpainter.setCompositionMode(QPainter::CompositionMode_SourceOver);
    newpainter.fillRect(temp.rect(), Qt::transparent);
    newpainter.drawImage(0, height(), mirrorImage);
    newpainter.drawImage(0, 0, copy(0,0,width(),height()));
    newpainter.end();

    Assign(temp);
}