QPainter QPixmap 抗锯齿

在paintEvent(QPaintEvent *)实现函数里绘制图片出现边缘锯齿解决办法:

 pixmap.loadFromData(sealImage,sealImageLen);
 pixmap =  pixmap.scaled(w, h, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);

 painter.setRenderHints(QPainter::SmoothPixmapTransform);

  painter.drawPixmap(0,i*(pageHeight+5),pageWidth,pageHeight,pix.transformed(matrix,Qt::SmoothTransformation));

你可能感兴趣的:(QT)