Changeset 6603
- Timestamp:
 - Aug 28, 2001, 8:58:57 PM (24 years ago)
 - File:
 - 
      
- 1 edited
 
- 
          
  trunk/src/gdi32/dibitmap.cpp (modified) (2 diffs)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/gdi32/dibitmap.cpp
r6594 r6603 1 /* $Id: dibitmap.cpp,v 1.2 6 2001-08-26 14:22:44sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.27 2001-08-28 18:58:57 sandervl Exp $ */ 2 2 3 3 /* … … 48 48 { 49 49 dprintf(("GDI32: CreateDIBitmap negative height! (%d,%d)", lpbmih->biWidth, lpbmih->biHeight)); 50 //TODO: doesn't work if memory is readonly!! 50 51 ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight; 52 53 if(lpbInit && fdwInit == CBM_INIT) { 54 // upside down 55 HBITMAP rc = 0; 56 long lLineByte = DIB_GetDIBWidthBytes(lpbmih->biWidth, lpbmih->biBitCount); 57 long lHeight = lpbmih->biHeight; 58 59 newbits = (WORD *)malloc( lLineByte * lHeight ); 60 if(newbits) { 61 unsigned char *pbSrc = (unsigned char *)lpbInit + lLineByte * (lHeight - 1); 62 unsigned char *pbDst = (unsigned char *)newbits; 63 for(int y = 0; y < lHeight; y++) { 64 memcpy( pbDst, pbSrc, lLineByte ); 65 pbDst += lLineByte; 66 pbSrc -= lLineByte; 67 } 68 rc = CreateDIBitmap(hdc, lpbmih, fdwInit, newbits, lpbmi, fuUsage); 69 free( newbits ); 70 } 71 72 ((BITMAPINFOHEADER *)lpbmih)->biHeight = iHeight; 73 return rc; 74 } 51 75 } 52 76  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  