Solved QPixmap save problem
-
Hi everyone,
I'm trying to save a simple QPixmap, but the result is not what I want.
This is my code:QPixmap CreatePixmap(200,200); QPainter CreatePainter(&CreatePixmap); CreatePainter.setBackground(Qt::white); CreatePainter.drawText(QPointF(10,10),"Hello world!!"); QFile SaveFile("AATest.bmp"); if(SaveFile.open(QIODevice::WriteOnly)) { CreatePixmap.save(&SaveFile, "BMP",100); } SaveFile.close();
This is the image.
Image linkWhat did I do wrong? I forgot something?
thanks
-
@Gianluca86 You should fillRect with white color instead.
-
@Gianluca86 You should fillRect with white color instead.
-
Thanks a lot, now is perfect.