creating an .bmp file
Unsolved
Qt for Python
-
hello all,
i'm new to PyQt and trying to create .bmp file with code below:self.img = QtGui.QImage(100, 50, QtGui.QImage.Format_Mono) self.paint_img = QtGui.QPainter() self.paint_img.drawText(self.img.rect(), Qt.AlignCenter, "Hello") self.img.save("test.bmp")
after running the output of the code is :
the .bmp file gets generated ,but the test "Hello" is not generated.Can someone help me to fix this issue ?
-
so what are the details of the file that is created? size? does bmp support monochrome images? what happens if you make a color bmp and set the background color for it as a solid color? does it view the backgorund color correctly? do some debugging on your own!
-
where do you link your painter to the image? I see rectangle bounds checking of img, but nothing making the painter paint into the image itself.