Changeset 1937 for trunk/src/gdi32/dibsect.cpp
- Timestamp:
- Dec 2, 1999, 2:26:05 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r1830 r1937 1 /* $Id: dibsect.cpp,v 1. 9 1999-11-24 19:30:18 sandervlExp $ */1 /* $Id: dibsect.cpp,v 1.10 1999-12-02 13:26:04 achimha Exp $ */ 2 2 3 3 /* … … 228 228 //****************************************************************************** 229 229 //****************************************************************************** 230 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nWidth, 231 int nHeight, int nXsrc, int nYsrc, DWORD Rop) 230 BOOL DIBSection::BitBlt(HDC hdcDest, int nXdest, int nYdest, int nDestWidth, 231 int nDestHeight, int nXsrc, int nYsrc, 232 int nSrcWidth, int nSrcHeight, DWORD Rop) 232 233 { 233 234 HPS hps = (HPS)hdcDest; … … 237 238 HWND hwndDest = WindowFromDC(hdcDest); 238 239 hwndDest = Win32ToOS2Handle(hwndDest); 239 if(hwndDest != 0) { 240 hps = WinGetPS(hwndDest); 241 } 242 if(hps == 0) { 243 eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest)); 244 return(FALSE); 245 } 246 247 dprintf(("DIBSection::BitBlt %X %x (%d,%d) to (%d,%d) (%d,%d) rop %x\n", hdcDest, hwndDest, nXdest, nYdest, nWidth, nHeight, nXsrc, nYsrc, Rop)); 240 if(hwndDest != 0) 241 { 242 hps = WinGetPS(hwndDest); 243 } 244 if(hps == 0) 245 { 246 eprintf(("DIBSection::BitBlt, hps == 0 hwndDest = %X", hwndDest)); 247 return(FALSE); 248 } 249 250 dprintf(("DIBSection::BitBlt %X %x to(%d,%d)(%d,%d) from (%d,%d)(%d,%d) rop %x\n", 251 hdcDest, hwndDest, nXdest, nYdest, nDestWidth, nDestHeight, 252 nXsrc, nYsrc, nSrcWidth, nSrcHeight, Rop)); 248 253 249 254 point[0].x = nXdest; 250 255 point[0].y = nYdest; 251 point[1].x = nXdest + n Width - 1;252 point[1].y = nYdest + n Height - 1;256 point[1].x = nXdest + nDestWidth - 1; 257 point[1].y = nYdest + nDestHeight - 1; 253 258 point[2].x = nXsrc; 254 259 point[2].y = nYsrc; 255 if(nXsrc + nWidth > pOS2bmp->cx) { 256 point[3].x = pOS2bmp->cx; 257 } 258 else point[3].x = nXsrc + nWidth; 259 260 if(nYsrc + nHeight > pOS2bmp->cy) { 261 point[3].y = pOS2bmp->cy; 262 } 263 else point[3].y = nYsrc + nHeight; 260 if(nXsrc + nSrcWidth > pOS2bmp->cx) 261 { 262 point[3].x = pOS2bmp->cx; 263 } 264 else 265 point[3].x = nXsrc + nSrcWidth; 266 267 if(nYsrc + nSrcHeight > pOS2bmp->cy) 268 { 269 point[3].y = pOS2bmp->cy; 270 } 271 else 272 point[3].y = nYsrc + nSrcHeight; 264 273 265 274 #if 1 266 if(fFlip & FLIP_VERT) { 267 GpiEnableYInversion(hps, nHeight); 268 } 269 270 if(fFlip & FLIP_HOR) { 275 if(fFlip & FLIP_VERT) 276 { 277 GpiEnableYInversion(hps, nDestHeight); 278 } 279 280 if(fFlip & FLIP_HOR) 281 { 271 282 ULONG x; 272 273 274 283 x = point[0].x; 284 point[0].x = point[1].x; 285 point[1].x = x; 275 286 } 276 287 #endif … … 278 289 rc = GpiDrawBits(hps, bmpBits, pOS2bmp, 4, &point[0], ROP_SRCCOPY, BBO_OR); 279 290 280 if(hwndDest != 0) { 281 WinReleasePS(hps); 291 if(hwndDest != 0) 292 { 293 WinReleasePS(hps); 282 294 } 283 295 if(rc == GPI_OK) 284 return(TRUE); 296 return(TRUE); 297 285 298 dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc)); 286 299 dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndDest)) & 0xFFFF)); … … 347 360 pDIBSection->dsBm.bmBitsPixel = pOS2bmp->cBitCount; 348 361 pDIBSection->dsBm.bmBits = bmpBits; 349 // BITMAPINFOHEADERdata350 362 // BITMAPINFOHEADER data 363 pDIBSection->dsBmih.biSize = sizeof(BITMAPINFOHEADER); 351 364 pDIBSection->dsBmih.biWidth = pOS2bmp->cx; 352 365 pDIBSection->dsBmih.biHeight = pOS2bmp->cy; … … 364 377 pDIBSection->dsBitfields[2] = 0; 365 378 366 367 368 369 370 379 pDIBSection->dshSection = this->handle; 380 381 pDIBSection->dsOffset = 0; // TODO: put the correct value here 382 383 return 0; //ERROR_SUCCESS 371 384 } 372 385 return 87; //ERROR_INVALID_PARAMETER
Note:
See TracChangeset
for help on using the changeset viewer.