rangers99
asked on
How Do I Display An Image stored as an Array of Longs in a Windows Form
Hello All
Im using Visual Studio 2008 and programming in C/C++
Ive an array of longs (obtained from a digital camera) that represent an image.
Lets call the array 'imgArray'
The array is big at 1002 * 1004
My question is simple. How do I display this image in a windows form?
Note I dont want to save it to the hard drive then load it again. I just want to display the pixel information stored in 'imgArray' directly into a windows form.
Can someone explain how I do this? Thanks.
Im using Visual Studio 2008 and programming in C/C++
Ive an array of longs (obtained from a digital camera) that represent an image.
Lets call the array 'imgArray'
The array is big at 1002 * 1004
My question is simple. How do I display this image in a windows form?
Note I dont want to save it to the hard drive then load it again. I just want to display the pixel information stored in 'imgArray' directly into a windows form.
Can someone explain how I do this? Thanks.
ASKER
abel
Each array entry represents the pixel colour. There is no header information. Its just a straightforward array of raw data.
Each array entry represents the pixel colour. There is no header information. Its just a straightforward array of raw data.
The size of a long is dependent on the architecture. It is 4 bytes or 8 bytes? If it is 4 bytes, what is the order of the pixels? Nothing - Red - Green - Blue? or Alpha - Red - Green - Blue? or Cyan - Magenta - Yellow - Black? There are other schemes even.
If it is 8 bytes, how to extract the color info?
How do you determine the width/height or is it always fixed to the dimensions 1002 x 1004?
If it is 8 bytes, how to extract the color info?
How do you determine the width/height or is it always fixed to the dimensions 1002 x 1004?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys. Ive not had time to try it out but Im sure this will work
Can you explain what the format is that your longs are using? How should the header information be interpreted (width, length, color depth, encoding, camera info etc)? Do you have a struct of some sort that represents your array?