Re: [Algorithms] OT: How to read a bitmap of arbitrary size?
Brought to you by:
vexxed72
From: Ray G. <ra...@da...> - 2000-08-13 17:28:54
|
Sounds like you need to take the rowbytes-per-scanline into consideration. Ray Gardener Daylon Graphics Ltd. http://www.daylongraphics.com/products/leveller "heightfield modeling perfected" -----Original Message----- From: Pai-Hung Chen <pa...@ac...> To: gda...@li... <gda...@li...> Date: Sunday, August 13, 2000 10:10 AM Subject: [Algorithms] OT: How to read a bitmap of arbitrary size? >Hi, > >I have been frustratingly bugged for hours and I decide to resort to the >list. I want to read a 24-bit bitmap heightfield. I can correctly read it >as long as the dimension of the bitmap file is in 2's power such as 4x4, >8x8, 16x16, etc. (But 2x2 doesn't work?!) In these _normal_ cases, the >*biSizeImage* field of the BITMAPINFOHEADER structure gives me the correct >size of image in bytes. However, if I create a bitmap of non-2's-power >dimension such as 5x5, 6x6, 7x7, etc., the *biSizeImage* field gives me some >bogus number. For example, 5x5 yields 80 bytes (5x5x3 = 75 bytes); 6x6 >yields 120 bytes (6x6x3 = 108 bytes); 7x7 yields 168 bytes (7x7x3 = 147 >bytes). Could somebody tell me what happened? > >Thanks in advance, > >Pai-Hung Chen > > > >_______________________________________________ >GDAlgorithms-list mailing list >GDA...@li... >http://lists.sourceforge.net/mailman/listinfo/gdalgorithms-list > |