Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualwintertime

Posted 06 January 2013 - 04:37 AM

Once a few years ago I wanted to write bmp load and safe routines too. What I found out was that the format is a badly documented, actually 5+ different incompatible formats with one file extension and if you pick one to write your data out you depend on the mercy and undocumented quirks of the loading routine of some other program you try to get your data into, to support this exact format and actually recognize the version you used and reads all headerfields exactly in the way you wrote them out and not just ignore some and read data at some offset itself always uses for writing.
You better just get some tested image library that can handle better file formats like for example png than rolling your own quirky bmp loader that works on some files but silently garbles others. Or if you really want to load a bmp at least use some Windows function so you can have halfway compatible quirks in your loading routine.

#2wintertime

Posted 06 January 2013 - 04:36 AM

Once a few years ago I wanted to write bmp load and safe routines too. What I found out was that the format is a badly documented, actually 5+ different incompatible formats with one file extension and if you pick one to write your data out you depend on the mercy and undocumented quirks of the loading routine of some other program you try to get your data into, to support this exact format and actually recognize the version you used and reads all headerfields exactly in the way you wrote them out and not just ignore some and read data at some offset itself always uses for writing.
You better just get some tested image library that can handle better file formats like for example png than rolling your own quirky bmp loader that works on some files but silently garbles others. Or if you really want to load a bmp at least use some Windows function so you can have halfway compatible quirks in your loading routine.

#1wintertime

Posted 06 January 2013 - 04:35 AM

Once a few years ago I wanted to write bmp load and safe routines too. What I found out was that the format is a badly documented, actually 5+ different incompatible formats with one file extension and if you pick one to write your data out you depend on the mercy and undocumented quirks of the loading routine of some other program you try to get your data into, to support this exact format and actually recognizes the version you used and reads all headerfields exactly in the way you wrote them out and not just ignore some and read data at some offset itself always uses for writing.

You better just get some tested image library that can handle better file formats like for example png than rolling your own quirky bmp loader that works on some files but silently garbles others. Or if you really want to load a bmp at least use some Windows function so you can have halfway compatible quirks in your loading routine.


PARTNERS