Issue
I have an image file , as C:/44637landscapes-2007.jpg
I want to load this file using QPixmap
using PySide
I tried as following .
pixmap = QPixmap('C:/44637landscapes-2007.jpg')
But documentation says like QPixmap(':/xxxxxx.jpeg')
. What does ':'
means ?
How do I load an image at 'C:\'
?
EDIT : The problem was with trying to load "JPEG"
. It was able to load "PNG"
, with no issues. So what else , I need to do to load "JPEG"
?
Thanks Jijoy
Solution
If you're trying to build your Python code to an executable this covers the issue for .ico files but the process is the same for JPEG: PyQt/PySide - icon display
If you're having problems when running from your installed interpreter then your path variable probably isn't set correctly, your qt.conf (in the base python dir) has been deleted/changed or you don't have qjpeg4.dll where its supposed to be (<python dir>\Lib\site-packages\PySide\plugins\imageformats
).
My qt.conf looks like:
[Paths]
Prefix = C:/Python27/lib/site-packages/PySide
Binaries = .
Plugins = plugins
Translation = translation
C:/Python27/lib/site-packages/PySide
is part of my system PATH variable and ahead of any PyQt (or other Qt) directories.
Answered By - Gerald
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.