Re: something wrong with BMPs

Search this archive.

From: Matan Ziv-Av (matan@svgalib.org)
Date: Thu 09 Dec 1999 - 22:36:15 IST


> Everything works well for pictures like 300 x 200
> or 800 x 600 pixels. When I use this code for a
> 90 x 35 bitmap I receive really strange values:
> Of course this is not exactly the case, but for example, it
> should appear like this:
> 
>         XXXXXXXXXXXXXXXXXXXXXXXXX
>         X                                                               X
>         X                                                               X
>         X                                                               X
>         XXXXXXXXXXXXXXXXXXXXXXXXX
> 
> but it appears like this:
> 
>         XXXXXXXXXXXXXXXXXXXXXXXXX
>                 X                                                      X
>               X                                                     X
>             X                                                     X
>          XXXXXXXXXXXXXXXXXXXXXXXXX

Without looking at your code, the problem is in alignment: either the
picture is really stored as if it was 92x30 (width a multiple of 4), or
your code assumes it is aligned, but it is not. From the picture you
draw it seems like the first case.


-- 
Matan Ziv-Av.                         matan@svgalib.org


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:22 IST