Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Converting bytearray to pixmap

Converting bytearray to pixmap

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    janaki
    wrote on last edited by
    #1

    QByteArray ba;
    QBuffer buffer(&ba);
    QImage img;
    img.load("hai.png");
    img.save(&buffer,"PNG");

    how should i display the image on to a label;
    i think the loaded image is saved in buffer .
    i tried to write it
    IO_WriteOnly function of File
    but am getting error as IO_Write is not declared in the scope
    though QFile is included

    can anybody help me out in solving

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Since you are reading a file, what don't you use "this":http://qt-project.org/doc/qt-4.8/qpixmap.html#QPixmap-4 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved