Solved

Reding bmp header return 65536 as width ??

Posted on 2010-09-05
1
321 Views
Last Modified: 2013-12-04
Hello, I am trying to read a bmp header this way:

typedef struct _SBMP3256
{
	BITMAPFILEHEADER bmfHeader;
	BITMAPINFOHEADER bmiHeader;
	RGBQUAD colors[256];
}BMP3256,*PBMP3256;

Open in new window


but this is what I get:

{biSize=9830400 biWidth=9830400 biHeight=65536 biPlanes = 32 ...

And the same code works in another program.
0
Comment
Question by:Greg2FS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 

Accepted Solution

by:
Greg2FS earned 0 total points
ID: 33605989
I found the solution, it is a compiler issue, it seems than the structure members alignement was not the same putting to 1 solve the problem.

Can do like that:
[code]#pragma pack(push, 1)

//structure(s)

#pragma pack(pop)[/code]
#pragma pack(push, 1)

//structure(s)

#pragma pack(pop)

Open in new window

0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question