Results 1 to 2 of 2

Thread: How to display image with QPixmap from QVector?

  1. #1
    Join Date
    Apr 2017
    Posts
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    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 17:27.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    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, 13:06
  2. Replies: 5
    Last Post: 28th April 2014, 14:22
  3. QSpinBox : display values from a QVector
    By CTZStef in forum Qt Programming
    Replies: 4
    Last Post: 6th December 2013, 14:13
  4. Replies: 2
    Last Post: 29th September 2008, 01:08

Tags for this Thread

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.