[vtkusers] reading raw file

nikhil singhania niksinghania at gmail.com
Tue Feb 9 07:47:24 EST 2010


I am trying to open a .raw image file stored on my hard drive in a C++
program to manipulate it.
After opening the file, want to save its pixel information in a 2-D
array. The image is a 256 X 256 with 8 bits per pixel and no header
bytes.

I would like the array to be dynamic so that i am not limited to only
a 256 X 256 image, but the 8-bit representation will be unchanged.

I figured using fstream in binary mode would work, but it doesn't seem
too or maybe i am using it wrong.

Can someone please show me how I can open the .raw file and then load
it into a dynamic array and the needed libraries.

If it makes any difference, I am using a window xp machine running
Visual Studio .Net 2005 as my c++ editor and compiler


-- 
Nikhil Kumar
rit2007033
b.tech IT 6th sem
IIIT Allahabad
contact at 9793905858
email: rit2007033 at iiita.ac.in
          niksinghania at gmail.com
http://profile.iiita.ac.in/RIT2007033/



More information about the vtkusers mailing list