Ignore:
Timestamp:
Oct 16, 2000, 1:01:47 PM (25 years ago)
Author:
sandervl
Message:

MN: GetDIBits fix for color masks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibitmap.cpp

    r4140 r4484  
    1 /* $Id: dibitmap.cpp,v 1.9 2000-09-01 01:36:14 phaller Exp $ */
     1/* $Id: dibitmap.cpp,v 1.10 2000-10-16 11:01:47 sandervl Exp $ */
    22
    33/*
     
    270270 int rc;
    271271
    272     rc =  O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
     272    rc = O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);
     273    // set proper color masks!
     274    switch(lpbi->bmiHeader.biBitCount) {
     275    case 16: //RGB 565
     276       ((DWORD*)(lpbi->bmiColors))[0] = 0xF800;
     277       ((DWORD*)(lpbi->bmiColors))[1] = 0x07E0;
     278       ((DWORD*)(lpbi->bmiColors))[2] = 0x001F;
     279       break;
     280    case 24:
     281    case 32:
     282       ((DWORD*)(lpbi->bmiColors))[0] = 0x0000FF;
     283       ((DWORD*)(lpbi->bmiColors))[1] = 0x00FF00;
     284       ((DWORD*)(lpbi->bmiColors))[2] = 0xFF0000;
     285       break;
     286    }
     287
    273288    dprintf(("GDI32: GetDIBits %x %x %d %d %x %x %d returned %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage, rc));
    274289    return rc;
Note: See TracChangeset for help on using the changeset viewer.