Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I have an image, including image header, stored in a c# byte array (byte []).

The header is at the beginning of the byte array.
If I put the header in a struct (as I did in c++) it looks like this:

C#
typedef struct RS_IMAGE_HEADER
{
   long HeaderVersion;
   long Width;
   long Height;
   long NumberOfBands;
   long ColorDepth;
   long ImageType;
   long OriginalImageWidth;
   long OriginalImageHeight;
   long OffsetX;
   long OffsetY;
   long RESERVED[54];
   long Comment[64];

} RS_IMAGE_HEADER;



How can I do it in c#, how can I get and use all the data in the image header (that stored in the beginning of the byte array)?

Thanks
Posted

1 solution

There is an example here: (You may have to tweak it a bit for your exact structure)
http://stackoverflow.com/questions/2871/reading-a-c-c-data-structure-in-c-sharp-from-a-byte-array[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900