Results 1 to 2 of 2

Thread: Load image to pixmap from internet

  1. #1
    Join Date
    Mar 2010
    Posts
    56
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Load image to pixmap from internet

    Hi, i'm triyng to load an image to a pixmap from internet. I already search for it and i know that i need to start a connection, download the file and after use is. Do you have know any example?

  2. #2
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    383
    Thanks
    52
    Thanked 42 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Load image to pixmap from internet

    It's really simple, use QtcpSocket, create GET Request, send request to the server, use readyRead() signal to retrieve the data, do that until all data are send from the server, close connection.
    Or alternative, and that's probably easier way to do, use QNetworkAccessManager and get() method to retrieve data.
    Also keep in mind that data from the server, only using QTcpSocket, cames with reply header that You need to strip, QNetworkAccessManager get() gaves You only the data.
    I personally prefer QTcpSocket, and I suggest You doing the same, because You will learn much more that way about networking.
    Best luck

Similar Threads

  1. Draw Image into Pixmap/Image
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 19th May 2010, 06:56
  2. How to use a image from internet
    By kellen851105 in forum Qt Programming
    Replies: 1
    Last Post: 4th March 2010, 06:16
  3. Is there a better way to load a big image?
    By learning_qt in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2008, 15:00
  4. best way to load image from db
    By C167 in forum Qt Programming
    Replies: 2
    Last Post: 10th April 2008, 18:24
  5. load pixmap from another host
    By raphaelf in forum Newbie
    Replies: 16
    Last Post: 31st August 2006, 22:58

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.