Results 1 to 5 of 5

Thread: Reading of ascii-file to QPixMap

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    4
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Reading of ascii-file to QPixMap

    Hi, I have a set of textfiles (ascii) that contains values. Each value represents a pixel that I somehow have to draw to screen, and each file contains thousands of lines which together represents an image. An example of a file:

    Qt Code:
    1. x y value
    2. ...
    3. 0.35040E+01 0.29280E+01 0.30385E+01
    4. 0.35040E+01 0.29760E+01 0.31362E+01
    5. 0.35040E+01 0.30240E+01 0.32857E+01
    6. //empty line that separates x-values
    7. 0.35520E+01 0.27840E+01 0.31625E+01
    8. 0.35520E+01 0.28320E+01 0.31206E+01
    9. 0.35520E+01 0.28800E+01 0.30607E+01
    10. ...
    To copy to clipboard, switch view to plain text mode 
    My question is, what would be the best approach to read a file of this type into a QPixMap (which then will be drawn to a QGraphicsView)? Or, should i preferably use something else than QPixMap?

    The x/y-values aren`t that important, the main point is that each value corresponds to a pixel. I have thought of reading them into an array, but I am quite uncertain of how I should use this array further.
    Last edited by fluxar; 5th October 2007 at 13:31.

Similar Threads

  1. QWT 5, QT3, SuSE 10.2. Crash and burn
    By DrMcCleod in forum Qwt
    Replies: 8
    Last Post: 7th September 2007, 20:53
  2. reading from a file
    By mickey in forum General Programming
    Replies: 32
    Last Post: 19th July 2007, 01:04
  3. Replies: 4
    Last Post: 10th July 2007, 20:11
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. Problem with reading a file
    By Buhmann in forum Qt Programming
    Replies: 11
    Last Post: 17th February 2006, 13:02

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.