Re: BMP pixel array
- From: "james" <james@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 23 May 2005 10:49:01 -0700
"Mike D Sutton" wrote:
> > 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.
>
> This is normal, each scan-line of Bitmap data is padded to align the next scan on a DWord (4-byte) boundary.
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@xxxxxxxx
> WWW: Http://EDais.mvps.org/
>
>
>
Ok but I have a question with a real file: I have a BMP file with 399 bytes
in width and I find three zeros at the end of a sigle line. 399 + 3 = 402;
402 / 4 = 100.5; Following you suggestion I have to find only one zero.
Infact: 399 + 1 = 400; 400 / 4 = 100; perfect division by 4. This is what I
can't understand.
Another curious question about BMP file is that I have seen a BMP Info
Header with dimension less than 40; in this case 12; I've seen that the file
width and height are in two byte everyone and not in four byte like the BMP
files with an Info Header of 40 byte. Is it right? Why it happen.
Thank you
.
- Follow-Ups:
- Re: BMP pixel array
- From: Mike D Sutton
- Re: BMP pixel array
- From: Carsten Neubauer
- Re: BMP pixel array
- From: Borek
- Re: BMP pixel array
- References:
- BMP pixel array
- From: james
- Re: BMP pixel array
- From: Mike D Sutton
- BMP pixel array
- Prev by Date: Re: Graphics "goes away"
- Next by Date: Re: Graphics "goes away"
- Previous by thread: Re: BMP pixel array
- Next by thread: Re: BMP pixel array
- Index(es):
Relevant Pages
|