Changeset 2551 for trunk/src/gdi32/oslibgdi.cpp
- Timestamp:
- Jan 28, 2000, 11:24:58 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/oslibgdi.cpp
r2049 r2551 1 /* $Id: oslibgdi.cpp,v 1. 2 1999-12-09 16:49:45 cbratschiExp $ */1 /* $Id: oslibgdi.cpp,v 1.3 2000-01-28 22:24:58 sandervl Exp $ */ 2 2 3 3 /* … … 27 27 UINT coloruse) 28 28 { 29 INT result ;29 INT result, rc; 30 30 POINTL points[4]; 31 BITMAPINFO2 os2bmpinfo; 31 32 32 33 // This is a quick hack. Only tested with winmine. Need much more testing. 33 34 // TODO: check parameter and info structure 34 35 lines = (int)lines >= 0 ? (int)lines : (int)-lines; 35 36 #if 0 // WINE99050837 tmpheight = height = info->bmiHeader.biHeight;38 width = info->bmiHeader.biWidth;39 if (height < 0) height = -height;40 if (!lines || (startscan >= height)) return 0;41 if (startscan + lines > height) lines = height - startscan;42 if (ySrc < startscan) ySrc = startscan;43 else if (ySrc >= startscan + lines) return 0;44 if (xSrc >= width) return 0;45 if (ySrc + cy >= startscan + lines) cy = startscan + lines - ySrc;46 if (xSrc + cx >= width) cx = width - xSrc;47 if (!cx || !cy) return 0;48 49 descr.dc = dc;50 descr.bits = bits;51 descr.image = NULL;52 descr.lines = tmpheight >= 0 ? lines : -lines;53 descr.infoWidth = width;54 descr.depth = dc->w.bitsPerPixel;55 descr.drawable = physDev->drawable;56 descr.gc = physDev->gc;57 descr.xSrc = xSrc;58 descr.ySrc = tmpheight >= 0 ? lines-(ySrc-startscan)-cy+(oldcy-cy)59 : ySrc - startscan;60 descr.xDest = dc->w.DCOrgX + XLPTODP( dc, xDest );61 descr.yDest = dc->w.DCOrgY + YLPTODP( dc, yDest ) +62 (tmpheight >= 0 ? oldcy-cy : 0);63 descr.width = cx;64 descr.height = cy;65 #endif66 36 67 37 points[0].x = xDest; … … 74 44 points[3].y = ySrc + lines; 75 45 76 // WINBITMAPINFOHEADER and BITMAPINFO2 are identical 77 GpiDrawBits((HPS)hdc, (VOID *)bits, (BITMAPINFO2 *)info, 4, 78 points, ROP_SRCCOPY, BBO_IGNORE); 46 memset(&os2bmpinfo, 0, sizeof(os2bmpinfo)); 47 os2bmpinfo.cbFix = sizeof(BITMAPINFO2) - sizeof(RGB2); 48 os2bmpinfo.cx = info->biWidth; 49 os2bmpinfo.cy = info->biHeight; 50 os2bmpinfo.cPlanes = info->biPlanes; 51 os2bmpinfo.cBitCount = info->biBitCount; 52 os2bmpinfo.ulCompression = info->biCompression; 53 os2bmpinfo.cbImage = info->biSizeImage; 54 os2bmpinfo.cxResolution = info->biXPelsPerMeter; 55 os2bmpinfo.cyResolution = info->biYPelsPerMeter; 56 os2bmpinfo.cclrUsed = info->biClrUsed; 57 os2bmpinfo.cclrImportant = info->biClrImportant; 79 58 59 // rc = GpiDrawBits((HPS)hdc, (VOID *)bits, &os2bmpinfo, 4, 60 // points, ROP_SRCCOPY, BBO_IGNORE); 61 62 // if(rc != GPI_OK) { 63 // dprintf(("GpiDrawBits returned %d", rc)); 64 // } 80 65 return lines; 81 66 } 82 67 //****************************************************************************** 83 68 //****************************************************************************** 84
Note:
See TracChangeset
for help on using the changeset viewer.