PDA

View Full Version : Loading jpeg (QPixmap with Qt Jambi)



Mr_Blonde
14th September 2006, 15:45
Hi,

I am playing around with Qt Jambi and trying to load a simple JPG picture. Normally this shouldn't be a problem. This is the code:



QPixmap img = new QPixmap("/Users/oliver/dev/LDV/QtJambi/res/mac.jpg");
System.out.println("Image loaded: " + img.width() + "x" + img.height());



The point here is, the size of the picture is allways 0 and no image is displayed. I also tried to use a relative path but this didn't work either.

Does someone has a hint or maybe already tried simmilar things with Qt Jambi?

Thanks,
Olli

jacek
14th September 2006, 16:25
I didn't try Qt Jambi yet, but normal Qt needs a plugin to be able to load JPEG images.

What does QImageReader::supportedImageFormats() return?

Mr_Blonde
14th September 2006, 16:41
Here we go. :-)

That was the problem. Used a PNG instead and it worked. Thanks a lot!


Those are the supported types of Qt Jambi (tech preview 2):
[bmp, pbm, pgm, png, ppm, xbm, xpm]

jacek
14th September 2006, 17:19
Those are the supported types of Qt Jambi (tech preview 2):
[bmp, pbm, pgm, png, ppm, xbm, xpm]
IMO it's just a matter of installing the right plugin or compiling it into Qt, as the above formats are supported by bare Qt (without any plugins).

Mr_Blonde
14th September 2006, 18:06
Since Qt Jambi is only a technology preview you can only download a binary version. I have no idea if there is a possibility to add other image type support yet.