Hi, 
I was testing the new interface for bmp on DirectFB. I noticed that for 24 & 32 
bmp files that colors were wrongly displayed. 
I debugged the interface, tried the following fix, & it worked on my board.
Original Code:case 24:               for (i = 0; i < data->width; i++) {        
            dst[i] = (buf[i*3+2]    ) |                              
(buf[i*3+1]<< 8) |                             (buf[i*3+0]<<16) |               
              0xff000000;               }               break;case 32:          
     for (i = 0; i < data->width; i++) {                    dst[i] = 
(buf[i*4+2]    ) |                              (buf[i*4+1]<< 8) |              
               (buf[i*4+0]<<16) |                             (buf[i*4+3]<<24); 
              }               break; Fixed Code:case 24:               for (i = 
0; i < data->width; i++) {                    dst[i] = (buf[i*3+0]    ) |       
                       (buf[i*3+1]<< 8) |                             
(buf[i*3+2]<<16) |                             0xff000000;               }      
         break;          case 32:               for (i = 0; i < data->width; 
i++) {                    dst[i] = (buf[i*4+0]    ) |                           
   (buf[i*4+1]<< 8) |                             (buf[i*4+2]<<16) |            
                 (buf[i*4+3]<<24);               }               break;
Hope it helps.
BR,
Amr Ali.
_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to