source: trunk/src/gdi32/dibsect.h@ 4

Last change on this file since 4 was 4, checked in by ktk, 26 years ago

Import

File size: 1.9 KB
Line 
1/* $Id: dibsect.h,v 1.1 1999-05-24 20:19:39 ktk Exp $ */
2
3/*
4 * GDI32 DIB sections
5 *
6 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11#ifndef __DIBSECT_H__
12#define __DIBSECT_H__
13
14#ifdef OS2_ONLY
15typedef struct {
16 BYTE rgbBlue;
17 BYTE rgbGreen;
18 BYTE rgbRed;
19 BYTE rgbReserved;
20} RGBQUAD, *LPRGBQUAD;
21#else
22#define BITMAPINFO2 DWORD
23#endif
24
25#define FLIP_VERT 1
26#define FLIP_HOR 2
27
28typedef struct {
29 DWORD biSize;
30 LONG biWidth;
31 LONG biHeight;
32 WORD biPlanes;
33 WORD biBitCount;
34 DWORD biCompression;
35 DWORD biSizeImage;
36 LONG biXPelsPerMeter;
37 LONG biYPelsPerMeter;
38 DWORD biClrUsed;
39 DWORD biClrImportant;
40} WINBITMAPINFOHEADER;
41
42class DIBSection
43{
44public:
45 DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip);
46 ~DIBSection();
47
48 char *GetDIBObject() { return bmpBits; };
49 void SelectDIBObject(HDC hdc);
50
51 void UnSelectDIBObject() { this->hdc = 0; };
52
53 BOOL BitBlt(HDC hdcDest, HWND hwndDest, int nXdest, int nYDest,
54 int nWidth, int nHeight, int nXsrc, int nYSrc, DWORD Rop);
55
56 int SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb);
57 static DIBSection *getSection() { return section; } ;
58 static DIBSection *find(DWORD handle);
59 static DIBSection *findHDC(HDC hdc);
60 static void deleteSection(DWORD handle);
61protected:
62
63private:
64 DWORD handle;
65 HWND hwndParent;
66 HDC hdc;
67 char *bmpBits;
68 BOOL fFlip;
69
70 BITMAPINFO2 *pOS2bmp;
71 // Linked list management
72 DIBSection* next; // Next DIB section
73 static DIBSection* section; // List of DIB sections
74};
75
76#endif
Note: See TracBrowser for help on using the repository browser.