HuntsvilleRob
Programmer
Hello.
Thought I'd ask; having a hard time figuring this out on my own. I am using Borland C++ Builder 6 on a PC running Windows XP.
I have a black and white image; I can put it in any format, bmp, jpg, tif, whatever. The image has pixel dimensions 500 x 500. Each pixel is a greyscale value from 0 (black)to 2^16 (white). I want to write C++ code that will read the image file and create an array, call it DataArray[500][500] where DataArray[j] is the greyscale value for the pixel in the ith row, the jth column. How can I create such an array? This would allow me, for example, to create a graph of the greyscale values along any column (for all the rows) or along any row (for all the column values in that row). Any help would be greatly appreciated. Thanks.
-Rob
Thought I'd ask; having a hard time figuring this out on my own. I am using Borland C++ Builder 6 on a PC running Windows XP.
I have a black and white image; I can put it in any format, bmp, jpg, tif, whatever. The image has pixel dimensions 500 x 500. Each pixel is a greyscale value from 0 (black)to 2^16 (white). I want to write C++ code that will read the image file and create an array, call it DataArray[500][500] where DataArray[j] is the greyscale value for the pixel in the ith row, the jth column. How can I create such an array? This would allow me, for example, to create a graph of the greyscale values along any column (for all the rows) or along any row (for all the column values in that row). Any help would be greatly appreciated. Thanks.
-Rob