Copy pm2 onto pm1, but preserve the alpha value from pm1 where pm2 is transparent. Opactiy controls wheather or not pm1 will show through. */
| 59 | Opactiy controls wheather or not pm1 will show through. |
| 60 | */ |
| 61 | QPixmap pixCombiner(const QPixmap* pm1, const QPixmap* pm2, const qreal inOpacity = 1) |
| 62 | { |
| 63 | QImage img1 = pm1->toImage().convertToFormat(QImage::Format_ARGB32); |
| 64 | QImage img2 = pm2->toImage().convertToFormat(QImage::Format_ARGB32); |
| 65 | QPainter painter(&img1); |
| 66 | |
| 67 | painter.setOpacity(inOpacity); |
| 68 | painter.drawImage(0, 0, img2); |
| 69 | painter.end(); |
| 70 | |
| 71 | return QPixmap::fromImage(img1); |
| 72 | } |
| 73 | |
| 74 | void initPixmaps(const QColor& newest, const QColor& oldest, const QColor& middle, const QColor& notThere) |
| 75 | { |