branch update for HEAD-2003050101
[reactos.git] / subsys / win32k / objects / objconv.c
1 #undef WIN32_LEAN_AND_MEAN
2 #include <windows.h>
3 #include <ddk/ntddk.h>
4
5 /* FIXME: Surely we should just have one include file that includes all of these.. */
6 #include <win32k/bitmaps.h>
7 #include <win32k/coord.h>
8 #include <win32k/driver.h>
9 #include <win32k/dc.h>
10 #include <win32k/print.h>
11 #include <win32k/region.h>
12 #include <win32k/gdiobj.h>
13 #include <win32k/pen.h>
14 #include "../eng/objects.h"
15
16 #define NDEBUG
17 #include <win32k/debug1.h>
18
19
20 PBRUSHOBJ PenToBrushObj(PDC dc, PENOBJ *pen)
21 {
22   BRUSHOBJ *BrushObj;
23   XLATEOBJ *RGBtoVGA16;
24
25   ASSERT( pen );
26
27   BrushObj = ExAllocatePool(NonPagedPool, sizeof(BRUSHOBJ));
28   BrushObj->iSolidColor = pen->logpen.lopnColor;
29
30   return BrushObj;
31 }
32
33 HBITMAP BitmapToSurf(PBITMAPOBJ BitmapObj)
34 {
35   HBITMAP BitmapHandle;
36
37   if (NULL != BitmapObj->dib)
38     {
39     BitmapHandle = EngCreateBitmap(BitmapObj->size, BitmapObj->dib->dsBm.bmWidthBytes,
40                                    BitmapFormat(BitmapObj->dib->dsBm.bmBitsPixel, BI_RGB),
41                                    0, BitmapObj->dib->dsBm.bmBits);
42     }
43   else
44     {
45     BitmapHandle = EngCreateBitmap(BitmapObj->size, BitmapObj->bitmap.bmWidthBytes,
46                                    BitmapFormat(BitmapObj->bitmap.bmBitsPixel, BI_RGB),
47                                    0, BitmapObj->bitmap.bmBits);
48     }
49
50   return BitmapHandle;
51 }