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:
x y value
...
0.35040E+01 0.29280E+01 0.30385E+01
0.35040E+01 0.29760E+01 0.31362E+01
0.35040E+01 0.30240E+01 0.32857E+01
//empty line that separates x-values
0.35520E+01 0.27840E+01 0.31625E+01
0.35520E+01 0.28320E+01 0.31206E+01
0.35520E+01 0.28800E+01 0.30607E+01
...
x y value
...
0.35040E+01 0.29280E+01 0.30385E+01
0.35040E+01 0.29760E+01 0.31362E+01
0.35040E+01 0.30240E+01 0.32857E+01
//empty line that separates x-values
0.35520E+01 0.27840E+01 0.31625E+01
0.35520E+01 0.28320E+01 0.31206E+01
0.35520E+01 0.28800E+01 0.30607E+01
...
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.
Bookmarks