Subj : Re: How to read a pixel from a DIB? To : borland.public.cpp.borlandcpp From : Sebastian Ledesma Date : Wed Oct 20 2004 05:33 pm Actually I found the working way: unsigned char *pixel=(unsigned char *)fondo->PixelPtr(xRef, fondo->FlippedY(yRef)); switch (fondo->BitsPixel()) { case 24: b= *pixel; //previuos version was r=*pixel g= *(pixel+1); r= *(pixel+2); //previous version was g=*(pixel+2) break; ... } Saludos Sebastian " Bruce Salzman" escribió en el mensaje news:4176868b$1@newsgroups.borland.com... > > > > That's the way I will use, only lazzines before coding. I have to > > convert > > X,Y coordinates into a linear coordinate (hey that's so hard!!! > > :-) ), also > > what about for non 24 bits bitmaps. In 16 bits bitmaps I will have > > RGB in 5 > > bits, in 8 bits I will have a palette index, and in 4 bits (old 16 > > colored > > bitmaps) something similar. > > .