Results 1 to 5 of 5

Thread: Loading jpeg (QPixmap with Qt Jambi)

  1. #1
    Join Date
    Sep 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Loading jpeg (QPixmap with Qt Jambi)

    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:

    Qt Code:
    1. QPixmap img = new QPixmap("/Users/oliver/dev/LDV/QtJambi/res/mac.jpg");
    2. System.out.println("Image loaded: " + img.width() + "x" + img.height());
    To copy to clipboard, switch view to plain text mode 


    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Loading jpeg (QPixmap with Qt Jambi)

    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?

  3. The following user says thank you to jacek for this useful post:

    Mr_Blonde (14th September 2006)

  4. #3
    Join Date
    Sep 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: Loading jpeg (QPixmap with Qt Jambi)

    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]

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Loading jpeg (QPixmap with Qt Jambi)

    Quote Originally Posted by Mr_Blonde
    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).

  6. #5
    Join Date
    Sep 2006
    Posts
    6
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X

    Default Re: Loading jpeg (QPixmap with Qt Jambi)

    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.

Similar Threads

  1. Replies: 7
    Last Post: 12th August 2006, 15:11
  2. Loading a custom image into a QPixmap
    By KShots in forum Qt Programming
    Replies: 12
    Last Post: 5th August 2006, 00:16
  3. QPixmap and HBITMAP
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 16:24

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.