source: trunk/src/gdi32/oslibgdi.cpp@ 5931

Last change on this file since 5931 was 5931, checked in by sandervl, 24 years ago

rop translation + getdibits fixes

File size: 2.4 KB
Line 
1/* $Id: oslibgdi.cpp,v 1.7 2001-06-08 11:03:33 sandervl Exp $ */
2
3/*
4 * GDI32 support code
5 *
6 * Copyright 1999 Edgar Buerkle (Edgar.Buerkle@gmx.net)
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11#define INCL_GPI
12#define INCL_WIN
13#include <os2wrap.h> //Odin32 OS/2 api wrappers
14#include <stdlib.h>
15#include <string.h>
16#include <win32type.h>
17#include <misc.h>
18#define OS2_ONLY
19#include "dibsect.h"
20#include "oslibgdi.h"
21
22#define DBG_LOCALLOG DBG_oslibgdi
23#include "dbglocal.h"
24
25#if 0
26//******************************************************************************
27//******************************************************************************
28INT OSLibSetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx, DWORD cy,
29 INT xSrc, INT ySrc, UINT startscan, UINT lines,
30 LPCVOID bits, BITMAPINFOHEADER_W *info,
31 UINT coloruse)
32{
33 INT result, rc;
34 POINTL points[4];
35 BITMAPINFO2 os2bmpinfo;
36
37 // This is a quick hack. Only tested with winmine. Need much more testing.
38 // TODO: check parameter and info structure
39 lines = (int)lines >= 0 ? (int)lines : (int)-lines;
40
41 points[0].x = xDest;
42 points[0].y = yDest + cy - 1; // Y-inverted
43 points[1].x = xDest + cx - 1;
44 points[1].y = yDest; // Y-inverted
45 points[2].x = xSrc;
46 points[2].y = ySrc + startscan;
47 points[3].x = xSrc + cx;
48 points[3].y = ySrc + lines;
49
50 memset(&os2bmpinfo, 0, sizeof(os2bmpinfo));
51 os2bmpinfo.cbFix = sizeof(BITMAPINFO2) - sizeof(RGB2);
52 os2bmpinfo.cx = info->biWidth;
53 os2bmpinfo.cy = info->biHeight;
54 os2bmpinfo.cPlanes = info->biPlanes;
55 os2bmpinfo.cBitCount = info->biBitCount;
56 os2bmpinfo.ulCompression = info->biCompression;
57 os2bmpinfo.cbImage = info->biSizeImage;
58 os2bmpinfo.cxResolution = info->biXPelsPerMeter;
59 os2bmpinfo.cyResolution = info->biYPelsPerMeter;
60 os2bmpinfo.cclrUsed = info->biClrUsed;
61 os2bmpinfo.cclrImportant = info->biClrImportant;
62
63 rc = GpiDrawBits((HPS)hdc, (VOID *)bits, &os2bmpinfo, 4,
64 points, ROP_SRCCOPY, BBO_IGNORE);
65
66 if(rc != GPI_OK) {
67 dprintf(("GpiDrawBits returned %d", rc));
68 }
69 return lines;
70}
71//******************************************************************************
72//******************************************************************************
73#endif
Note: See TracBrowser for help on using the repository browser.