Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Reding bmp header return 65536 as width ??

Posted on 2010-09-05
1
Medium Priority
?
331 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
 
LVL 1

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
By default Outlook 2016 displays only one time zone in the Calendar. The following article explains how to display two time zones in one calendar view.
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

670 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