- Timestamp:
- Feb 6, 2003, 9:28:09 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibitmap.cpp
r9614 r9764 1 /* $Id: dibitmap.cpp,v 1.3 8 2003-01-04 18:18:05sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.39 2003-02-06 20:28:09 sandervl Exp $ */ 2 2 3 3 /* … … 238 238 { 239 239 PalSize = dsect->GetBitCount(); 240 if(PalSize <= 8) 240 241 if(!ppvBits && PalSize <= 8) 241 242 { 242 243 ULONG Pal[256], nrcolors; 243 244 LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}}; 244 HPALETTE hpalCur , hpalTmp;245 HPALETTE hpalCur; 245 246 246 247 // Now get the current Palette from the DC 247 hpalTmp = CreatePalette(&tmpPal); 248 hpalCur = SelectPalette(hdc, hpalTmp, FALSE); 248 hpalCur = GetCurrentObject(hdc, OBJ_PAL); 249 249 250 250 // and use it to set the DIBColorTable 251 251 nrcolors = GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 252 252 dsect->SetDIBColorTable(0, nrcolors, (LPPALETTEENTRY)&Pal); 253 254 // Restore the DC Palette255 SelectPalette(hdc,hpalCur,FALSE);256 DeleteObject(hpalTmp);257 253 } 258 254
Note:
See TracChangeset
for help on using the changeset viewer.