Creating BMP file

Discussion in 'Programmer's Corner' started by StephenDJ, Jan 15, 2009.

  1. StephenDJ

    Thread Starter Active Member

    May 31, 2008
    58
    0
    Hi, does anyone know what the Pixels per Meter (bytes 38-45) parameter in a BMP file does? I can read the file one byte at a time into my program using
    OPEN "R",1,"filename.BMP",1
    FIELD #1,1 AS BYTE$
    GET #1,offset
    PRINT ASC(BYTE$)

    but different values appear in this field for different files and I'm not sure how to render this or know what values to put there.
     
    Last edited: Jan 15, 2009
  2. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Bytes 38 to 41 (4 bytes) gives the horizontal resolution in pixels per meter.

    Bytes 42 to 45 (4 bytes ) gives the vertical resolution in pixels per meter.

    Bytes up to offset 53 give information about the image

    Bytes 54 on give the color map.

    Do you need anything else?
     
  3. bertus

    Administrator

    Apr 5, 2008
    15,645
    2,344
  4. StephenDJ

    Thread Starter Active Member

    May 31, 2008
    58
    0
    Thanks, I've googled everywhere, have the information on the format, and know what bytes goes where in the file but I still can't figure out exactly what to do with the pixels/meter value for either dimension. I think it has something to do with the scaling, -how big or small the image appears regardless of how many pixels it actually has. I looked at bertus's links but they just simply state that is the "resolution in pixels per meter" and give nothing more. (-confused)
     
    Last edited: Jan 15, 2009
Loading...