I am not the best paint-brush !

to make a color picture to greyscale i make so.

Is here a other mode to grab moore quality?

Qt Code:
  1. #include <QApplication>
  2. #include <QtGui>
  3. #include <QtCore>
  4. #include <QCoreApplication>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QApplication app(argc, argv);
  9. QLabel *label = new QLabel("Hello Picasso");
  10. QPixmap bw = QPixmap("test.png","",Qt::MonoOnly);
  11.  
  12. QImage base0("test.png");
  13. QImage base = base0.convertToFormat(QImage::Format_MonoLSB,Qt::MonoOnly);
  14. /////QPixmap display;
  15. QPixmap xnew(base.width(),base.height());
  16. xnew.fill();
  17.  
  18. /* paint B/W */
  19. QPainter painter;
  20. painter.begin(&xnew);
  21. ////// painter.setRenderHint(QPainter::Antialiasing);
  22. painter.drawImage(0,0,QImage("test.png"));
  23. painter.drawImage(base.width() / 2,0,base);
  24. painter.end();
  25.  
  26. label->setPixmap(xnew);
  27. label->show();
  28. return app.exec();
  29. }
To copy to clipboard, switch view to plain text mode