patrik08
22nd March 2007, 20:42
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?
#include <QApplication>
#include <QtGui>
#include <QtCore>
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Picasso");
QPixmap bw = QPixmap("test.png","",Qt::MonoOnly);
QImage base0("test.png");
QImage base = base0.convertToFormat(QImage::Format_MonoLSB,Qt::M onoOnly);
/////QPixmap display;
QPixmap xnew(base.width(),base.height());
xnew.fill();
/* paint B/W */
QPainter painter;
painter.begin(&xnew);
////// painter.setRenderHint(QPainter::Antialiasing);
painter.drawImage(0,0,QImage("test.png"));
painter.drawImage(base.width() / 2,0,base);
painter.end();
label->setPixmap(xnew);
label->show();
return app.exec();
}
to make a color picture to greyscale i make so.
Is here a other mode to grab moore quality?
#include <QApplication>
#include <QtGui>
#include <QtCore>
#include <QCoreApplication>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Picasso");
QPixmap bw = QPixmap("test.png","",Qt::MonoOnly);
QImage base0("test.png");
QImage base = base0.convertToFormat(QImage::Format_MonoLSB,Qt::M onoOnly);
/////QPixmap display;
QPixmap xnew(base.width(),base.height());
xnew.fill();
/* paint B/W */
QPainter painter;
painter.begin(&xnew);
////// painter.setRenderHint(QPainter::Antialiasing);
painter.drawImage(0,0,QImage("test.png"));
painter.drawImage(base.width() / 2,0,base);
painter.end();
label->setPixmap(xnew);
label->show();
return app.exec();
}