Solved

Reding bmp header return 65536 as width ??

Posted on 2010-09-05
1
305 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
1 Comment
 

Accepted Solution

by:
Greg2FS earned 0 total points
Comment Utility
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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

A Bare Metal Image backup allows for the restore of an entire system to a similar or dissimilar hardware. They are highly useful for migrations and disaster recovery. Bare Metal Image backups support Full and Incremental backups. Differential backup…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now