Changeset 20624
- Timestamp:
- May 14, 2003, 1:39:59 PM (22 years ago)
- Location:
- tags/trunk/src/gdi32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/gdi32/dibitmap.cpp ¶
r20306 r20624 1 /* $Id: dibitmap.cpp,v 1. 39 2003-02-06 20:28:09 sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.40 2003-05-14 11:39:59 sandervl Exp $ */ 2 2 3 3 /* … … 366 366 dprintf(("GDI32: GetDIBits %x %x %d %d %x %x (biBitCount %d) %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, lpbi->bmiHeader.biBitCount, uUsage)); 367 367 368 #if 0 369 if(lpvBits && DIBSection::getSection() != NULL) 370 { 371 DIBSection *dsect; 372 373 dsect = DIBSection::findObj(hBitmap); 374 if(dsect) { 375 char *bmpBits = dsect->GetDIBObject(); 376 377 if(lpbi->bmiHeader.biBitCount == dsect->GetBitCount() && 378 lpbi->bmiHeader.biWidth > 0) 379 { 380 LONG lLineByte; 381 382 dprintf(("Quick copy from DIB section memory")); 383 lLineByte = DIB_GetDIBWidthBytes(lpbi->bmiHeader.biWidth, lpbi->bmiHeader.biBitCount); 384 385 memcpy(lpvBits, bmpBits+(uStartScan*lLineByte), cScanLines*lLineByte); 386 return cScanLines; 387 } 388 } 389 } 390 #endif 391 368 392 //SvL: WGSS screws up the DC if it's a memory DC 369 393 // TODO: Fix in WGSS (tries to select another bitmap in the DC which fails) … … 415 439 } 416 440 else { 441 LONG height = lpbi->bmiHeader.biHeight; 442 443 if(lpbi->bmiHeader.biHeight < 0) { 444 lpbi->bmiHeader.biHeight = -lpbi->bmiHeader.biHeight; 445 } 417 446 nrlines = O32_GetDIBits(hdcMem, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage); 447 448 //restore height 449 lpbi->bmiHeader.biHeight = height; 418 450 } 419 451 … … 470 502 } 471 503 472 //WGSS/Open32 returns 0when querying the bitmap info; must return nr of scanlines473 // as 0 signals failure504 //WGSS/Open32 returns 1 when querying the bitmap info; must return nr of scanlines 505 //(0 signals failure) 474 506 if(lpvBits == NULL) { 475 nrlines = cScanLines; 507 if(nrlines != 0) 508 nrlines = cScanLines; 509 else dprintf(("GetDIBits failed!!")); 476 510 } 477 511 return nrlines; -
TabularUnified tags/trunk/src/gdi32/dibsect.cpp ¶
r20502 r20624 1 /* $Id: dibsect.cpp,v 1.6 5 2003-04-01 15:57:05sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.66 2003-05-14 11:39:59 sandervl Exp $ */ 2 2 3 3 /* … … 141 141 dibinfo.dsBitfields[0] = dibinfo.dsBitfields[1] = dibinfo.dsBitfields[2] = 0; 142 142 if(palsize) { 143 SetDIBColorTable(0, ( 1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1));143 SetDIBColorTable(0, (pbmi->biClrUsed) ? pbmi->biClrUsed : (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1)); 144 144 } 145 145 } … … 350 350 dprintf(("DIBSection::SetDIBits (%d,%d), %d %d", pbmi->biWidth, pbmi->biHeight, pbmi->biBitCount, pbmi->biCompression)); 351 351 if(palsize) { 352 SetDIBColorTable(0, 1 << pbmi->biBitCount, (RGBQUAD *)(pbmi+1));352 SetDIBColorTable(0, (pbmi->biClrUsed) ? pbmi->biClrUsed : (1 << pbmi->biBitCount), (RGBQUAD *)(pbmi+1)); 353 353 } 354 354 … … 393 393 { 394 394 pOS2bmp->argbColor[i].fcOptions = 0; 395 #ifdef DEBUG396 395 dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) )); 397 #endif398 396 } 399 397 return(cEntries); … … 420 418 pOS2bmp->argbColor[i].bGreen = palentry[i].peGreen; 421 419 pOS2bmp->argbColor[i].bRed = palentry[i].peRed; 422 #ifdef DEBUG423 420 dprintf2(("Index %d : 0x%08X\n",i, *((ULONG*)(&pOS2bmp->argbColor[i])) )); 424 #endif425 421 } 426 422
Note:
See TracChangeset
for help on using the changeset viewer.