I'm trying load a jpg image, but the code doesnt works.
Look, have this:
Qt Code:To copy to clipboard, switch view to plain text mode
This code only works with png, gif and bmp files but doesnt with jpg.
Any advice?
Thanks.
I'm trying load a jpg image, but the code doesnt works.
Look, have this:
Qt Code:To copy to clipboard, switch view to plain text mode
This code only works with png, gif and bmp files but doesnt with jpg.
Any advice?
Thanks.
Install a jpg decoder.
Or, in other words, did you compile Qt with jpg support?
I dont know. How can i "compile Qt with jpg suppot"?
What Qt package did you install?
I installed only Qt SDK.
Check if the qt/2010.05/bin/imageFormats folder contains qjpeg4.dll
Yes, its there.
Change your code to use a value instead of a pointer for the image.
Example:
Qt Code:
class YourWidgetClass { private: QImage img; };To copy to clipboard, switch view to plain text mode
In the constructor:
Qt Code:
img.load(fileName);To copy to clipboard, switch view to plain text mode
If that doesn't solve your problem, the filename is wrong.
I did what you told me. But doesnt works.
Only the bmp, png and gif works....
The path is correct otherwise how can the others formats works?
Very simple:
1. The code you posted is not the real code of your program? But I guess it is.
2. Back to my first reply, you do not have a jpg decoder on your computer that is able to work with Qt.
I don't understand your problem. I installed the Qt SDK and showing jpg's works for me, so it is not a Qt SDK problem, it is either a problem with your code or with your system.
I think that problem is with system.
I compiled/ran the same code just now but in linux, and its works!
tbscope, thanks for your attention!
Just a last question: Why did you say to me change the *img pointers to img? Is there any problem with pointers use? How can I know when use pointer or not?
Thanks again.
Bookmarks