Hi,

I need to read the size of the bitmap image (width x height) using C. If I can read the header information of the image my purpose will be served. Please let me know how I can achieve this? Please help me

Regards

  • created

    Feb '11
  • last reply

    Mar '11
  • 1

    reply

  • 528

    views

  • 2

    users

22 days later

We can read a BMP using pure C code, but it's not easy... I found here an example written entirely in C which can read a 8-bit BMP file.. There is another way though... The C language recognizes assembler instructions. Each file has a header which gives all the info required to make the OS "understand" it. This part isn't located exactly at the begining at the file.. It depends! Of course knowing these values and where to find them it would be easy just to configure them! You'll need assembler language for this. I found the BMP header file at the second link (not much info though...). Also, a way to work with it (and an example of code that understands 256-bits BMP and not only) is at the last link.. Although it's in pascla the code it's adaptable very easy to C Hope this helps!

Suggested Topics

Topic Category Replies Views Activity
C and C++ 0 13 5d

Want to read more? Browse other topics in C and C++ or view latest topics.