Hi, I'm trying to save somthing I draw using QPainter to image file. My code looks like that:
QImage image(800,600,QImage::Format_RGB32);
QPainter paint;
paint.begin(&image);
paint.drawRect(10,10,50,50);
paint.end();
image.save("image.bmp");
What I get is a totally black image with some different colours strips. But when I use existing image like that:
QImage image("image.bmp");
QPainter paint;
paint.begin(&image);
paint.drawRect(10,10,50,50);
paint.end();
image.save("image.bmp");
ewerything is fine. I don't know where is the problem. Maybe you will have some ideas. Thanks in avance.
Bookmarks