Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor pit_29's Avatar
    Join Date
    Jul 2011
    Posts
    100
    Does anyone know how to form an image from a buffer?
    Thus type:
    ` QBuffer* buffer = new QBuffer(this->Conex);
    QImage* image = new QImage ();
    image->loadFromData (buffer->buffer());`
    this does not work for me
    thanks

  2. #2
    Nokia Developer Expert Devnull's Avatar
    Join Date
    Sep 2011
    Posts
    381
    loadFromData method isn't meant to read image from raw pixels matrix, but to read binary data in a specific format, i.e. when you read contents of *.png file and pass it to loadFromData method.

    The image.save method may resolve the problem:

    QImage image;
    QByteArray ba;
    QBuffer buffer(&ba);
    buffer.open(QIODevice::WriteOnly);
    image.save(&buffer, "PNG"); // writes image into ba in PNG format

    /0

Similar Threads

  1. how to read file and get value in sepreat buffer
    By manmay.gupta in forum Symbian C++
    Replies: 3
    Last Post: 2010-12-08, 10:29
  2. Read/Write from Serial port Buffer
    By Kavit Patel in forum Symbian C++
    Replies: 1
    Last Post: 2008-06-05, 12:51
  3. How to read the Record data into Buffer?
    By Sneha1 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2008-01-22, 07:03
  4. Read a integer from buffer
    By zhenLeow in forum Symbian C++
    Replies: 1
    Last Post: 2003-11-03, 06:32
  5. Read integer value from buffer
    By zhenLeow in forum Symbian C++
    Replies: 3
    Last Post: 2003-09-19, 03:49

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved