Quote Originally Posted by e8johan View Post
I do this aswell, but I had to put a QImageReader in between:

Qt Code:
  1. QByteArray array = qry.value(0).toByteArray();
  2. QBuffer buffer(&array);
  3. buffer.open( QIODevice::ReadOnly );
  4.  
  5. QImageReader reader(&buffer, "PNG");
  6. QImage image = reader.read();
To copy to clipboard, switch view to plain text mode 

The code did not work unless I opened the buffer explicitly, so don't forget that.

Thanks for Reply.
But What is qry?and how to open buffer explicitly.
Also Is QImageReader reader(&buffer, "PNG") used to constuct a PNG Image or what?
If yes then If I donot know what type of Image is this then What Will I do?