home *** CD-ROM | disk | FTP | other *** search
/ Windows Graphics Programming / Feng_Yuan_Win32_GDI_DirectX.iso / Samples / include / BitmapInfo.h < prev    next >
C/C++ Source or Header  |  2000-05-11  |  1KB  |  41 lines

  1. #pragma once
  2.  
  3. //-----------------------------------------------------------------------------------//
  4. //              Windows Graphics Programming: Win32 GDI and DirectDraw               //
  5. //                             ISBN  0-13-086985-6                                   //
  6. //                                                                                   //
  7. //  Written            by  Yuan, Feng                             www.fengyuan.com   //
  8. //  Copyright (c) 2000 by  Hewlett-Packard Company                www.hp.com         //
  9. //  Published          by  Prentice Hall PTR, Prentice-Hall, Inc. www.phptr.com      //
  10. //                                                                                   //
  11. //  FileName   : bitmapinfo.h                                                         //
  12. //  Description: BITMAPINFO wrapper                                                 //
  13. //  Version    : 1.00.000, May 31, 2000                                              //
  14. //-----------------------------------------------------------------------------------//
  15.  
  16. class KBitmapInfo
  17. {
  18. public:
  19.  
  20.     typedef struct
  21.     {
  22.         BITMAPINFOHEADER bmiHeader;
  23.         RGBQUAD              bmiColors[256+3];
  24.     }    DIBINFO;
  25.  
  26.     DIBINFO m_dibinfo;
  27.  
  28.     void SetFormat(int width, int height, int bitcount, int compression = BI_RGB);
  29.  
  30.     void SetGrayScale(DWORD mask);
  31.  
  32.     BITMAPINFO * GetBMI(void) const
  33.     {
  34.         return (BITMAPINFO *) & m_dibinfo;
  35.     }
  36.  
  37.     BITMAPINFO * CopyBMI(void) const;
  38.     
  39. };
  40.  
  41.