Load blob image data into QPixmap?

You can use the QImage. FromData static method to load an image from a string and then convert it to a pixmap.

You can use the QImage. FromData static method to load an image from a string and then convert it to a pixmap: image_data = get_image_data_from_blob() qimg = QtGui.QImage. FromData(image_data) pixmap = QtGui.QPixmap.

FromImage(qimg).

The approach suggested by Ants Aasma works and actually it is also OK to just use the following code: image_data = cPickle. Loads(str(s)) # s is fetched from DB qp = QPixmap() qp. LoadFromData(image_data) Thanks a lot for all the help and information.

After a good hour and a half of googleing to solve a similar problem, I ended up loading JPEGs in a compiled . Exe with QT. I am using python3.1, and therefore could not use some of the previously mentioned solutions : tips working for py2exe (because I am using cxfreeze instead of py2exe, as py2exe works only for python2), tips that require PIL (also only for python2, afaik).

While the solutions posted here didn't work, something very similar did : I simply copied the PythonDir\Lib\site-packages\PyQt4\plugins\imageformats to my exe's folder and removed the qt. Conf file that I created in that folder following other solutions. That's all (I think :p).

After that, it worked whether I loaded the jpg using QPixmap's constructor or loading a QImage first. It also worked with no special option needed for both the setup. Py and the cxfreeze.

Bat methods of compiling to exe using cxfreeze. (this solution was posted by jbz on thetoryparty.com/wp/2009/08/27/pyqt-and-...) This question is a bit old, but as the problem seems to be still there, I hope this answer will help python3.1 users out there.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions