| Last change
 on this file since 1089 was             97, checked in by phaller, 26 years ago | 
        
          | 
Add: added cvs variable $Id$ to source files.
 | 
        
          | File size:
            1.9 KB | 
      
      
| Line |  | 
|---|
| 1 | /* $Id: dibsect.h,v 1.3 1999-06-10 17:09:03 phaller 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 | 
|---|
| 12 | typedef 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 |  | 
|---|
| 25 | typedef 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 |  | 
|---|
| 39 | class DIBSection | 
|---|
| 40 | { | 
|---|
| 41 | public: | 
|---|
| 42 | DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip); | 
|---|
| 43 | ~DIBSection(); | 
|---|
| 44 |  | 
|---|
| 45 | char *GetDIBObject()           { return bmpBits;  }; | 
|---|
| 46 | void  SelectDIBObject(HDC hdc); | 
|---|
| 47 |  | 
|---|
| 48 | void  UnSelectDIBObject()      { this->hdc = 0;   }; | 
|---|
| 49 |  | 
|---|
| 50 | BOOL  BitBlt(HDC hdcDest, HWND hwndDest, int nXdest, int nYDest, | 
|---|
| 51 | int nWidth, int nHeight, int nXsrc, int nYSrc, DWORD Rop); | 
|---|
| 52 |  | 
|---|
| 53 | int  SetDIBColorTable(int startIdx, int cEntries, RGBQUAD *rgb); | 
|---|
| 54 | static DIBSection *getSection() { return section; } ; | 
|---|
| 55 | static DIBSection *find(DWORD handle); | 
|---|
| 56 | static DIBSection *findHDC(HDC hdc); | 
|---|
| 57 | static       void  deleteSection(DWORD handle); | 
|---|
| 58 | protected: | 
|---|
| 59 |  | 
|---|
| 60 | private: | 
|---|
| 61 | DWORD handle; | 
|---|
| 62 | HWND  hwndParent; | 
|---|
| 63 | HDC   hdc; | 
|---|
| 64 | char *bmpBits; | 
|---|
| 65 | BOOL  fFlip; | 
|---|
| 66 |  | 
|---|
| 67 | BITMAPINFO2 *pOS2bmp; | 
|---|
| 68 | // Linked list management | 
|---|
| 69 | DIBSection*    next;                   // Next DIB section | 
|---|
| 70 | static    DIBSection*    section;                // List of DIB sections | 
|---|
| 71 | }; | 
|---|
| 72 |  | 
|---|
| 73 | #endif | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.