Results 1 to 5 of 5

Thread: Almost reading QImage line by line, help me please.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    18
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Cool Almost reading QImage line by line, help me please.

    Qt folks

    Im trying to open a image file and display it line by line, after i get this working i want the line by line image data to be sent over the network to another system and have a qt app display this image data line by line on a QGraphicsScene. I think im almost there as far as showing the image data line by line, im just not sure if im getting the correct values in my test app, this is a small application can anyone tell me if im on the right track here?
    I dont think this example is correct. At this point i just want line by line image data. Im not to worried about how to transfer it over the network yet, but i will need to send it in chunks of like 20 lines at a time over a socket. Here is a small example using a qt4 image.

    Qt Code:
    1. #include <QApplication>
    2. #include <QtGui>
    3. #include <iostream>
    4.  
    5. using namespace std;
    6.  
    7. int main (int argc, char *argv[])
    8. {
    9. QApplication app (argc, argv);
    10. QImage* pImage = new QImage("/images/qt4.jpg");
    11.  
    12. for ( int line = 0; line < pImage->height(); line++ )
    13. {
    14. for ( int pos = 0; pos < pImage->width(); pos++ )
    15. {
    16. cout << pImage->scanLine(line) << endl;
    17. cout << pImage->scanLine(pos) << endl;
    18. }
    19. }
    20. return app.exec ();
    21. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 21st July 2008 at 18:45. Reason: missing [code] tags

Similar Threads

  1. QTcpSocket exception.
    By Fastman in forum Qt Programming
    Replies: 9
    Last Post: 29th January 2008, 13:51
  2. Some very weird compilation warnings
    By MarkoSan in forum Qt Programming
    Replies: 21
    Last Post: 23rd January 2008, 16:48
  3. Qwizard crashed when created in a slot
    By joshlareau in forum Qt Programming
    Replies: 9
    Last Post: 15th January 2008, 09:16
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42

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