Results 1 to 6 of 6

Thread: sending QImage over serial port

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Dec 2007
    Location
    London
    Posts
    206
    Thanks
    40
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Question Re: sending QImage over serial port

    Ok.. I havent used QImage or QImagereader before; and perhaps I misunderstand them...

    Hello, i am trying to send a QImage file over serial port; but i couldn't manage it..
    There is no data sent in serial port monitor, when i send the file "avatar.gif"..(with send function of Qextserialport)
    Am i missing something...

    What i understand is that:

    Qt Code:
    1. QByteArray bytes;// a bytes array formed
    2.  
    3. QImage picture(80, 80,QImage::Format_RGB32); // a picture object formed
    4.  
    5. QImageReader reader("C:/Documents and Settings/pc/MyDocuments/Visual Studio 2005/Projects/videocapture3/avatar.gif"); //avatar.gif is read into "reader"
    6.  
    7. reader.read(&picture); // reads the image from reade into picture..
    8.  
    9. picture.loadFromData(bytes); // bytes are filled here
    10.  
    11. sp->send(bytes.size(),bytes.data());// bytes are sent here
    To copy to clipboard, switch view to plain text mode 


    is that wrong?
    Last edited by jpn; 16th January 2008 at 21:37. Reason: missing [code] tags

Similar Threads

  1. serial port communiction
    By jagadish in forum Qt Programming
    Replies: 4
    Last Post: 7th July 2007, 12:04
  2. How to write bytes read from serial port to a QFile
    By shamik in forum Qt Programming
    Replies: 19
    Last Post: 25th June 2007, 14:12
  3. First attempt to display serial port data on GUI
    By ShaChris23 in forum Newbie
    Replies: 12
    Last Post: 4th May 2007, 09:14
  4. qt network performance
    By criss in forum Qt Programming
    Replies: 16
    Last Post: 24th July 2006, 09:23
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.