Results 1 to 2 of 2

Thread: How to display image with QPixmap from QVector?

  1. #1
    Join Date
    Apr 2017
    Qt products

    Default How to display image with QPixmap from QVector?

    Could someone help me with displaying video from a camera. The values from camera are stored in QVector. Is it possible to display it this way?

    My data is stored in QVector<uint16_t> then i want to scale it to QVector<uint8_t> and into QPixmap class. Or if it's possible directly from QVector<uint16_t> to QPixmap class
    Last edited by smilč; 3rd April 2017 at 16:27.

  2. #2
    Join Date
    Jan 2006
    Warsaw, Poland
    Thanked 5,010 Times in 4,789 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Unix/X11 Windows Android Maemo/MeeGo
    Blog Entries
    Wiki edits

    Default Re: How to display image with QPixmap from QVector?

    uint16_t is different than uint8_t. You'd have to create a new vector and copy data from the original one. Then you can use QImage::loadFromData() or something similar.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.

Similar Threads

  1. Replies: 1
    Last Post: 18th October 2015, 12:06
  2. Replies: 5
    Last Post: 28th April 2014, 13:22
  3. QSpinBox : display values from a QVector
    By CTZStef in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2013, 13:13
  4. Replies: 2
    Last Post: 29th September 2008, 00:08

Tags for this Thread


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.