Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / May 2005

Tip: Looking for answers? Try searching our database.

BMP pixel array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
james - 22 May 2005 18:39 GMT
I don't know if this is the right place to show my question.
I can't understand why, in the BMP array after the headers, i find some zero
that aren't in the real BMP image. This zero are at the end of a single pixel
row. Sometime i find three zeros. I've seen, in a web page, that if a row
ins't a multiple of 4 it need to add one, two or three zeros to reach this
multiple of 4. I've tried to understand it but with no positive result.
Somebody can explain me how this work? If you know a code about it better.

james
Tamas Demjen - 23 May 2005 17:13 GMT
Each row starts at a DWORD (4-byte) boundary. Here's how to calculate
the size of each line in bytes:

(Width * BitsPerPixel + 31) / 32 * 4

where Width is the width in pixels, BitsPerPixel is 1, 4, 8, 16, 24, 32,
etc. (the biBitCount field in the header). The difference between the
minimum bytes and the actual bytes per row is

(Width * BitsPerPixel + 31) / 32 * 4 - (Width * BitsPerPixel + 7) / 8

and it's filled by all 0s.

Tom

> I don't know if this is the right place to show my question.
> I can't understand why, in the BMP array after the headers, i find some zero
[quoted text clipped - 5 lines]
>
> james

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.