×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Feb 2011
    Posts
    15

    Fastest way to load image from website?

    Hi, I'm trying to download images from internet, then scale them and finally draw in my application, but there's a little bottleneck when the image is loaded with the method loadFromData. The code is something like this:


    Code:
    void MyClass::replyFinished(QNetworkReply(QNetworkReply *reply){
          QImage webImg;
          webImg.loadFromData(reply->readAll(),0);
          ....
          ....
    }
    Image size can be anything but it uses to take 100~200 ms which is a little problem if the app should run at 60fps. Is there a better way to do this and increase performance? I don't use a separate thread because replyFinished should be executed in parallel, but could I modify the priority somehow?
    Last edited by Sheenmue; 2011-04-09 at 14:06.

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

    Re: Fastest way to load image from website?


  3. #3
    Registered User
    Join Date
    Feb 2011
    Posts
    15

    Re: Fastest way to load image from website?

    Thanks, as I have to scale down most of the images prescaling them with qimagereader before calling QImageReader::read() method has been a BIG improvement. I also must say I was wrong, moving the http request to a separate thread has helped to improve performance. The way I was doing it initially it seems replyFinished was blocking the main GUI thread.

    Thanks again.

Similar Threads

  1. Fastest way to show camera viewfinder with overlay
    By pixsta in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2011-01-28, 07:17
  2. ***********Fastest way to draw to Image?
    By none800 in forum Mobile Java General
    Replies: 5
    Last Post: 2010-11-19, 11:47
  3. Fastest possible way to autostart on boot
    By giedi1 in forum Symbian
    Replies: 6
    Last Post: 2010-01-27, 20:22
  4. Fastest way to draw stretched bitmap
    By neois in forum Symbian
    Replies: 5
    Last Post: 2008-03-10, 07:17
  5. fastest way to read a file
    By ed_welch in forum Symbian
    Replies: 6
    Last Post: 2008-02-13, 11:27

Posting Permissions

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