[fpc-pascal] BLOCKWRITE-restrictions in writing .bmp-file?

Arjan van Dijk Arjan.van.Dijk at rivm.nl
Wed Sep 17 20:31:53 CEST 2008


> >       IF (((NDum    ) MOD 4)<>0) THEN
> > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel));
> >       IF (((NDum + 1) MOD 4)<>0) THEN
> > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel));
> >       IF (((NDum + 2) MOD 4)<>0) THEN
> > BLOCKWRITE(OutFile,Pixel,SIZEOF(Pixel));
>
> 1. If NDum = 4k (e.g. 12=4*3), you write two times; if NDum = 4k + 3
> (e.g. 15=5*3), you write two times. It's not right.
>
> 2. Check sizeof-s. Are you sure they are one byte each?
>
> 3. Are you sure the code worked good before?


I modified the code a bit to make it better readable, but, as you remarked,
with an error
in the padding of the line! I'll recheck my original code and come back.
Thanks!

A.





More information about the fpc-pascal mailing list