PDA

View Full Version : How to display image with QPixmap from QVector?



smilč
3rd April 2017, 16:39
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

wysota
19th April 2017, 12:42
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.