Subj : Re: BITMAPINFO To : borland.public.cpp.borlandcpp From : "Tim Jackson" Date : Wed Aug 06 2003 04:35 pm "Scan lines must be zero padded to end on a LONG boundary" means the total length of each line must be rounded up to an integral multiple of 32 bits, for the purposes of calculating the position of line starts or total buffer length. In other words every line begins on a byte whose address is divisible by 4. (Dynamic allocation normally ensures the first line is so placed, if the buffer is allocated statically you may need to set your compiler to align data on doubleword boundaries.) "Segment boundaries can appear anywhere in a bitmap" .means you don't have to worry about segments, your bitmap can be placed at any memory address divisible by 4. "Why will the 8bit bitmap not display". This is not a limitation on bitmap dimensions, which is all the information you have given. If the bitmap does not display at all then use GetLastError() and FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,,,,) to find out why. For example is the DIB compressed with an unavailable codec? If it displays scrambled, then the DIB is probably misformatted, ie buffer contents do not match BITMAPINFOHEADER data.. Tim Jackson "Tristan Szaniawski" wrote in message news:3f30e2c8@newsgroups.borland.com... > In Win3.1 SDK, in the description of BITMAPINFO structure it is said: > "The bits in the array are packed together, but each scan line > must be zero-padded to end on a LONG boundary. Segment boundaries, > however, can appear anywhere in the bitmap." It`s about DIB array bits. > What does 'zero-padded to end on a LONG boundary' mean ? > SetDIBitsToDevice does not display 258x265x8bit bitmap, but displays > 204x293x24bit bitmap. 0xFFFF / 258 = 254 + 4 so the line begins in one segment and ends > in another, but 0xFFFF / (204*3) = 107 + 52 so this line also starts in one segment and > ends in another. So why 24bit bitmap is displayed and 8bit isn`t ? > I work under win16bit > > Thank You > .