Subj : Re: Screen Capture function To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Fri Jul 02 2004 03:47 pm Jeff Baker wrote: >anybody has some time to look this over and offer a suggestion I would >appreciate it. Couple observasions without looking into the validity of your BMP. >pal[0] = 0; pal[1] = 0; pal[2] = 0; // Borland Color # 0 Pallets are usually RGB structs. Or you could be more clear as in char pal[16][3] = { {0,0,0}, // Borland Color # 0 {42,21,0}, // Borland Color # 1 {0,42,21}, // Borland Color # 2 . . . . {63,63,63} }; // Borland Color # 15 >for (x = 0; x < 16; x++) > { > fputc((short)pal[0 + (x * 3)] << 2,out); fputc( pal[x][0], out ); >fseek(out,bmp.offset,SEEK_SET); Don't Seek that which you haven't written. If the above writing doesn't put you in the proper place, write some more (or less, as the case may be). >for (y = (int)bmp.height; y > 0; y--) Don't you want to go to zero? You start too high and end too soon. > { > for (x = 0; x < bmp.width; x++) > { > pixel = getpixel(x,y); > fwrite(&pixel,sizeof(pixel),1,out); I think BMP.Width _must_ be 8 pixel boundry. Pad if width%8 != 0 >rewind(out); What is this? Reel-To-Reel tape? Don't rewind before closing. Don't rewind unless you have a reason to do so (hardly ever). .