Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8765907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:24:37+00:00 2026-06-13T16:24:37+00:00

I have an image, including image header, stored in a c# byte array (byte

  • 0

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:

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T16:24:39+00:00Added an answer on June 13, 2026 at 4:24 pm

    Structs are perfectly fine in C#, so there should be no issue with the struct pretty much exactly as you’ve written it, though you might need to add permission modifiers such as public. To convert byte arrays to other primitives, there are a very helpful class of methods that include ToInt64() that will help you convert an array of bytes to another built in type (in this case long). To get the specific sequences of array bytes you’ll need, check out this question on various techniques for doing array slices in C#.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I have Image like this (source: de-viz.ru ) I want to get something
So I have Image like this (source: de-viz.ru ) I want to get something
I have this image. It's a map of the UK (not including Southern Ireland):
So in my HTML markup I have an image tag like this one: <img
I have image Array with two images out of that first image its showing
I have image map that can I move, but this map will be so
we want to build a website that have some forms (including image attachments, info,
I have noticed that using the post_thumbnail() function in Wordpress inserts the image including
I am wondering if including image thumbnail information in the model makes sense. Like
I have image on server of dimension 1000x800. I download it using following approaches:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.