Link to home
Start Free TrialLog in
Avatar of rangers99
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.
Avatar of abel
abel
Flag of Netherlands image

There are many ways of internally representing image data. Apparently this is yet another one. Without in-depth knowledge about what each long stands for, it will be quite hard to transform it into a BMP format, which could consequently be used to display the image.

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?
Avatar of rangers99
rangers99

ASKER

abel
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?
ASKER CERTIFIED SOLUTION
Avatar of jgordos
jgordos
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks guys. Ive not had time to try it out but Im sure this will work