Re: BITMAPINFOHEADER quirk - Programmer

This is a discussion on Re: BITMAPINFOHEADER quirk - Programmer ; "Robert Stankowic" schrieb im Newsbeitrag news:3f8ea19f$0$28246$91cee783@newsreader02.highwa y.telekom.at... > Hello, > I am reading a .bmp file and processing it's contents. No problem, but: > the biWidth member of the BITMAPINFOHEADER struct stored in the file header > does not give ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Re: BITMAPINFOHEADER quirk

  1. Re: BITMAPINFOHEADER quirk


    "Robert Stankowic" schrieb im Newsbeitrag
    news:3f8ea19f$0$28246$91cee783@newsreader02.highwa y.telekom.at...
    > Hello,
    > I am reading a .bmp file and processing it's contents. No problem, but:
    > the biWidth member of the BITMAPINFOHEADER struct stored in the file

    header
    > does not give the correct width info. In order to get it right, I have to
    > "round" the value up to multiples of 4, in a funny way:
    > 1, 2, 3, 4 must become 8
    > (if the width has to be a multiple of 4, I'd expect 4)
    > 5, 6, 7, 8 must become 12 (0xc) 9, 0xa, 0xb, 0xc must become 0x10
    > and
    > 0xd, 0xe, 0xf, 0x10 must become 14
    > Does anybody here know the reason for that?


    Sorry, the fault was elsewhere in my code, in fact the width just must be a
    multiple of 4, but I still wonder, why biWidth gives values which are not a
    multiple of 4

    Robert



  2. Re: BITMAPINFOHEADER quirk

    Robert Stankowic wrote:
    > why biWidth gives values
    > which are not a multiple of 4


    Because, if it did, you wouldn't know how many of the bytes had real
    data and how many were just padding.


  3. Re: BITMAPINFOHEADER quirk


    "Elias Fotinis" schrieb im Newsbeitrag
    news:1066479525.686147@athprx02...
    > Robert Stankowic wrote:
    > > why biWidth gives values
    > > which are not a multiple of 4

    >
    > Because, if it did, you wouldn't know how many of the bytes had real
    > data and how many were just padding.


    Thanks, should have been thinking of that myself
    Robert



+ Reply to Thread