QPixmap pix1(":/PixmapTest/Resources/Chrysanthemum.jpg");

QPixmap temp(pix1.size());
temp.fill(Qt::transparent);

QPainter p1(&temp);
p1.setCompositionMode(QPainter::CompositionMode_Source);
p1.drawPixmap(0, 0, pix1);
p1.setCompositionMode(QPainter::CompositionMode_DestinationIn);
p1.fillRect(temp.rect(), QColor(0, 0, 0, 64));
p1.end();
pix1 = temp;

相关文章:

  • 2022-12-23
  • 2021-10-11
  • 2021-11-11
  • 2021-12-15
  • 2022-12-23
  • 2021-07-03
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2021-06-06
相关资源
相似解决方案