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 8084275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:44:35+00:00 2026-06-05T17:44:35+00:00

I have a weird issue with creating an Bitmap in C++. I’m using the

  • 0

I have a weird issue with creating an Bitmap in C++. I’m using the BITMAPFILEHEADER and BITMAPINFOHEADER Structure for creating an 8bit grayscale image. Bitmap data is coming from a camera over DMA as unsigned char an has exactly the same lenghts as expected. Saving the image an opening it, it contains colors?!

The way it should be: http://www.freeimagehosting.net/qd1ku
The way it is: http://www.freeimagehosting.net/83r1s

Do you have any Idea where this is comping from?

The Header of the bitmap is:

42 4D 36 00 04 00 00 00 00 00 36 00 00 00 28 00
00 00 00 02 00 00 00 02 00 00 01 00 08 00 00 00
00 00 00 00 04 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00

    Info-Header:
    42 4D           Its a Bitmap
    36 00 04 00     Size of Bitmap = 0x04 00 36 - Header-Size = 512x512
    00 00 00 00     Reserved
    36 00 00 00     Offset = Sizeof(Bitmapinfoheader);
    28 00 00 00     Sizeof(Bitmapinfoheader);
    00 02 00 00     =0x200 = 512 px.
    00 02 00 00     same
    01 00           = 1 - Standard. Not used anymore.
    08 00           Color dept = 8 bit.
    00 00 00 00     Compression: 0 = none.
    00 00 00 00     Filesize or zero
    00 00 00 00     X-Dot-Per-Meter, may be left 0
    00 00 00 00     y-Dot-Per-Meter, may be left 0
    00 00 00 00     If zero, all 255 colors are used
    00 00 00 00     If zero, no color table values are used

Do you have any Idea where this comes from?

  • 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-05T17:44:37+00:00Added an answer on June 5, 2026 at 5:44 pm

    Under windows, if you do not supply a palette for your 8 bit image a system default one is provided for you. I do not recall offhand the win32 way to add a palette, but it should be as simple as creating a 256 element char array where the value of each entry is the same as its index, and writing it out to your file at the appropriate point and updating the offset parameter, etc.

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

Sidebar

Related Questions

I am creating a store in Magento and have a weird issue with IE6
I have a weird issue with printing data out. I use printf to print
I'm have a weird issue here. I have a UITableView using custom UITableViewCells. Everything
I have a weird issue using polymorphism. I have a base class that implements
I have this weird issue in Magento when someone places an order using PayPal
I have this weird issue with special characters. In JSP, I am using field
I have a weird issue reading a .csv file using c#. Here are the
i have a weird issue. Im using TortoiseGIT (Win7) and my repositories are placed
I have a weird issue. Here is the setup: I have a NSOperationQueue which
I have a weird issue. I have some icons that are being built based

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.