- Timestamp:
- Dec 28, 2002, 3:01:37 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/blit.cpp
r9429 r9558 1 /* $Id: blit.cpp,v 1.4 1 2002-11-26 10:53:06sandervl Exp $ */1 /* $Id: blit.cpp,v 1.42 2002-12-28 14:01:37 sandervl Exp $ */ 2 2 3 3 /* … … 251 251 252 252 //If upside down, reverse scanlines and call SetDIBitsToDevice again 253 if(info->bmiHeader.biHeight < 0 && info->bmiHeader.biBitCount != 8 && info->bmiHeader.biCompression == 0) { 253 // if(info->bmiHeader.biHeight < 0 && info->bmiHeader.biBitCount != 8 && info->bmiHeader.biCompression == 0) { 254 if(info->bmiHeader.biHeight < 0 && (info->bmiHeader.biCompression == BI_RGB || 255 info->bmiHeader.biCompression == BI_BITFIELDS)) 256 { 254 257 // upside down 255 258 INT rc = -1; … … 262 265 char *newBits = (char *)malloc( lLineByte * lHeight ); 263 266 if(newBits) { 264 unsigned char *pbSrc = (unsigned char *)bits + lLineByte * (lHeight - 1);267 unsigned char *pbSrc = (unsigned char *)bits + xSrc + lLineByte * (ySrc + lHeight - 1); 265 268 unsigned char *pbDst = (unsigned char *)newBits; 266 269 for(int y = 0; y < lHeight; y++) { … … 269 272 pbSrc -= lLineByte; 270 273 } 271 rc = SetDIBitsToDevice( hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (void *)newBits, &newInfo, coloruse ); 274 //We only convert the necessary data so xSrc & ySrc are now 0 275 rc = SetDIBitsToDevice( hdc, xDest, yDest, cx, cy, 0, 0, startscan, lines, (void *)newBits, &newInfo, coloruse ); 272 276 free( newBits ); 273 277 }
Note:
See TracChangeset
for help on using the changeset viewer.