Hi,
why my programm didn't show JPG? There is definitely wrong with my code.Can the expert help me figure it out.
Thx in advance
Code:
Printable View
Hi,
why my programm didn't show JPG? There is definitely wrong with my code.Can the expert help me figure it out.
Thx in advance
Code:
Help for figuring it out:
Start with the obvious one: check what .load returns. "Returns true if the image was successfully loaded; otherwise returns false."
Two observations:
- You don't need a file URI for a local file, just use the path.
- QImage::load() takes a file name, not a URI (it uses QFile).
- You don't need to go via a QImage to load QPixmap from a JPEG file.
OK, that's three.
Thx mvuori and ChrisQ67.
i changed the Path to:
Code:
myImage.load("/home/ipan/test.png");
and it works.
@ChrisW67
This is just a test programm. Actually i have to fetch "picture file" that has been loaded with QImage class and showing it in on the screen. So i actualy need this to works.Quote:
You don't need to go via a QImage to load QPixmap from a JPEG file.
:) thx again guys