Results 1 to 6 of 6

Thread: Rapid Update of Pixmap

  1. #1
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Rapid Update of Pixmap

    Hi

    I am having problems updating and displaying a (8bit) pixmap using data provided by another thread. The pixmap is created from a Qimage. The QImage is created from binary data sent over ethernet link using udp protocol. The data is sent as 1k packets every 1 millisecond. (the QImage is 1k x 2k )

    A seperate thread processes the network packets and emits a signal on every packet, the gui thread then updates the QImage with pixel data and a new pixmap is created with the new data and shown on a QLabel.

    However the display cannot keep up with the network data rate. It appears that the QPixmap::fromImage(...) function is the bottleneck. This is called every 1ms (packet frequency). Any ideas on how to speed this up?

    Regards

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Rapid Update of Pixmap

    Well, you don't have displays this fast. Not to mention human eye+brain combination. So it's not really helpful to try to get a 1ms fast display.

    Just update some internal data, and trigger an update of the pixmap every 20ms or so.
    The illusion to human beings will be just fine and your hardware and Qt should be able to do that, too.

    HTH

  3. #3
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rapid Update of Pixmap

    Thanks Caduel

    However I have tried that. The problem is the conversion from QImage to QPixmap taking too long (The image is 2k wide by 1k high) The QImage is constructed one vertical line at at time. I want to give the illusion of a rolling display .

    I receive a vertical line of binary data every 1 millisecond over ethernet link using udp. A signal is emitted for every line that is received

    I append this vertical line of data to the QImage and convert to Pixmap for display on a QLabel. This is taking far too long. Is there a better way? Is there a way to append each new vertical line of data to the pixamp without having to do the conversion from image to pixmap?

    Thanks

  4. #4
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rapid Update of Pixmap

    Hi

    Struggling with this.

    I need to update a pixmap line by line from raw data. Presently I convert from QImage for display on a label. Can anyone offer a better/quicker solution?

    Regards

  5. #5
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Rapid Update of Pixmap

    Hi,

    Try using OpenGL.
    Òscar Llarch i Galán

  6. #6
    Join Date
    Oct 2008
    Posts
    74
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Rapid Update of Pixmap

    Hi

    Is it not possible to update a pixmap line by line? Is it possible to paint slices of the Image as I receive them?

    Regards

Similar Threads

  1. Problem in QProgressBar update
    By nikhilqt in forum Qt Programming
    Replies: 0
    Last Post: 10th March 2009, 10:20
  2. Qt Update project - Opinions wanted
    By pvdk in forum Qt Programming
    Replies: 0
    Last Post: 8th November 2008, 08:41
  3. Performance problems with small pixmap
    By RThaden in forum Qt Programming
    Replies: 4
    Last Post: 9th July 2008, 15:14
  4. finding maximum scaling of a pixmap
    By babu198649 in forum Newbie
    Replies: 1
    Last Post: 31st March 2008, 14:32
  5. empty pixmap as a QLabel
    By tommy in forum Qt Programming
    Replies: 16
    Last Post: 11th December 2007, 21:15

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.