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

Last change on this file since 1837 was 1830, checked in by sandervl, 26 years ago

EB's dibsection updates

File size: 2.6 KB
Line 
1/* $Id: dibsect.h,v 1.6 1999-11-24 19:30:18 sandervl Exp $ */
2
3/*
4 * GDI32 DIB sections
5 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
6 * Project Odin Software License can be found in LICENSE.TXT
7 */
8#ifndef __DIBSECT_H__
9#define __DIBSECT_H__
10
11#ifdef OS2_ONLY
12typedef struct {
13 BYTE rgbBlue;
14 BYTE rgbGreen;
15 BYTE rgbRed;
16 BYTE rgbReserved;
17} RGBQUAD, *LPRGBQUAD;
18#else
19#define BITMAPINFO2 DWORD
20#endif
21
22#define FLIP_VERT 1
23#define FLIP_HOR 2
24
25typedef struct {
26 DWORD biSize;
27 LONG biWidth;
28 LONG biHeight;
29 WORD biPlanes;
30 WORD biBitCount;
31 DWORD biCompression;
32 DWORD biSizeImage;
33 LONG biXPelsPerMeter;
34 LONG biYPelsPerMeter;
35 DWORD biClrUsed;
36 DWORD biClrImportant;
37} WINBITMAPINFOHEADER;
38
39typedef struct
40{
41 INT bmType;
42 INT bmWidth;
43 INT bmHeight;
44 INT bmWidthBytes;
45 WORD bmPlanes;
46 WORD bmBitsPixel;
47 LPVOID bmBits;
48} WINBITMAP, *LPWINBITMAP;
49
50#ifdef OS2_ONLY
51typedef struct
52{
53 WINBITMAP dsBm;
54 WINBITMAPINFOHEADER dsBmih;
55 DWORD dsBitfields[3];
56 HANDLE dshSection;
57 DWORD dsOffset;
58} DIBSECTION,*LPDIBSECTION;
59#endif
60
61class DIBSection
62{
63public:
64 DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip);
65 ~DIBSection();
66
67 char *GetDIBObject() { return bmpBits; };
68 void SelectDIBObject(HDC hdc);
69
70 void UnSelectDIBObject() { this->hdc = 0; };
71
72 BOOL BitBlt(HDC hdcDest, int nXdest, int nYDest,
73 int nWidth, int nHeight, int nXsrc, int nYSrc, DWORD Rop);
74
75 int SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb);
76
77 int SetDIBits(HDC hdc, HBITMAP hbitmap, UINT startscan, UINT
78 lines, const VOID *bits, WINBITMAPINFOHEADER *pbmi,
79 UINT coloruse);
80
81 int GetDIBSection(int iSize , DIBSECTION *pDIBSection);
82
83 static DIBSection *getSection() { return section; } ;
84 static DIBSection *find(DWORD handle);
85 static DIBSection *findHDC(HDC hdc);
86 static void deleteSection(DWORD handle);
87protected:
88
89private:
90 DWORD handle;
91 HWND hwndParent;
92 HDC hdc;
93 char *bmpBits;
94 BOOL fFlip;
95 int bmpsize;
96 BITMAPINFO2 *pOS2bmp;
97 // Linked list management
98 DIBSection* next; // Next DIB section
99 static DIBSection* section; // List of DIB sections
100};
101
102#endif
103
Note: See TracBrowser for help on using the repository browser.