| 440 | } |
| 441 | |
| 442 | QPixmap BitmapFactoryInst::fillRect(int x, int y, int w, int h, const QPixmap& p, Qt::BGMode bgmode) const |
| 443 | { |
| 444 | QBitmap b = p.mask(); |
| 445 | if (b.isNull()) { |
| 446 | return p; // sorry, but cannot do anything |
| 447 | } |
| 448 | |
| 449 | QPixmap pix = p; |
| 450 | |
| 451 | // modify the mask |
| 452 | QPainter pt; |
| 453 | pt.begin(&b); |
| 454 | if (bgmode == Qt::OpaqueMode) { |
| 455 | pt.fillRect(x, y, w, h, Qt::color1); // make opaque |
| 456 | } |
| 457 | else { // Qt::TransparentMode |
| 458 | pt.fillRect(x, y, w, h, Qt::color0); // make transparent |
| 459 | } |
| 460 | pt.end(); |
| 461 | |
| 462 | pix.setMask(b); |
| 463 | |
| 464 | return pix; |
| 465 | } |
| 466 | |
| 467 | QPixmap BitmapFactoryInst::merge(const QPixmap& p1, const QPixmap& p2, bool vertical) const |
| 468 | { |