×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    21

    load large pixmap on s60

    Dear all.
    QPixmap(file); can load some small jpg. But when it's size is larger than 1200*1200(about 200KB), it can not be load. And png is wrose.
    I've set these:
    TARGET.EPOCHEAPSIZE = 0x020000 0x3200000
    QPixmapCache::setCacheLimit(10240);

    Should I use icl fbs or something else?
    I don't want to scale the pixmap. I'm wroking on x6, which has a 128MB ram.

    How to display the large pixmap??

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: load large pixmap on s60

    for larger images you have to use QImageReader http://doc.qt.nokia.com/4.7/qimagereader.html

  3. #3
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: load large pixmap on s60

    A 1200 x 1200 image is 1,440,000 pixels. Each pixel occupies 4 bytes in standard representation, or 5,760,000 bytes.

    Keep in mind that you can't display an image at that resolution anyway. Use QImageReader.

  4. #4
    Registered User
    Join Date
    Feb 2010
    Posts
    21

    Re: load large pixmap on s60

    Thanks!
    And how can QImageReader detect the size of the image?
    I should know the size of the image before I clip the image and use QList to store the parts.

    If setClipRect() is outside of the image, will I get a null image?
    Last edited by Taiga; 2011-04-11 at 03:09.

  5. #5
    Super Contributor
    Join Date
    Nov 2009
    Location
    Minnesota, USA
    Posts
    3,209

    Re: load large pixmap on s60

    Well,we don't know what you're trying to do, so we can't really tell you how. But note that most image file architectures include a header that tells you the image size.

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: load large pixmap on s60

    Quote Originally Posted by Taiga View Post
    Thanks!
    And how can QImageReader detect the size of the image?
    I should know the size of the image before I clip the image and use QList to store the parts.

    If setClipRect() is outside of the image, will I get a null image?
    QImageReader::Size() will give you the actual size and use can resizeing rater then cliping ...

  7. #7
    Registered User
    Join Date
    Feb 2010
    Posts
    21

    Re: load large pixmap on s60

    I just want to display the images in my phone. But their size are various. So I should know how many parts the image should be clipped into.
    ________________
    |______|______|_|
    |______|______|_|

    _________________________
    |______|______|______|____|
    |______|______|______|____|
    |______|______|______|____|
    |______|______|______|____|
    Last edited by Taiga; 2011-04-11 at 06:19.

  8. #8
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: load large pixmap on s60

    so you can get the image size from QImageReader::Size() and QApplication::desktop()->screenGeometry() will give you your phone's screen size.

  9. #9
    Registered User
    Join Date
    Feb 2010
    Posts
    21

    Re: load large pixmap on s60

    QImageReader reader(file);
    int hei=reader.size().height();
    int wid=reader.size().width();

    for(int i=0;i<wid/640;i++){
    for(int j=0;j<hei/360;j++){
    QImageReader read(file);
    read.setClipRect(QRect(i*640,j*360,640,360));
    QGraphicsPixmapItem *pitem=scene->addPixmap(QPixmap::fromImage(read.read()));
    pitem->setPos(i*640,j*360);
    }
    }
    Thanks
    It works! But SLOW... about 15s for a (2700*1200)png.

    Is there a faster way? And what's the largest resolution(now is 640*360) it can load?

  10. #10
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: load large pixmap on s60

    one way i do resize is this
    Code:
        QImageReader reader(fileName);
        QSize imageSize = reader.size();
        imageSize.scale(QSize(newWidth,newHeight), Qt::IgnoreAspectRatio);
        reader.setScaledSize(imageSize);
        QImage scaledimage = reader.read();

Similar Threads

  1. Problem with large file transfer in S60 5th edition phones
    By supran2811 in forum Mobile Java General
    Replies: 0
    Last Post: 2010-11-12, 06:21
  2. S60 UI designer for large project
    By lenclud in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 3
    Last Post: 2009-04-24, 18:44
  3. S60 Ticker Load
    By rootroot in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2008-09-09, 08:44
  4. Replies: 1
    Last Post: 2007-11-23, 20:35
  5. signed app doesn't load on e61 (s60 3rd ed device)
    By cwhite124 in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2006-04-12, 13:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×