home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / atl / atlbutton / dibapi.h < prev    next >
C/C++ Source or Header  |  1998-03-26  |  2KB  |  49 lines

  1. // dibapi.h
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13.  
  14. #ifndef _INC_DIBAPI
  15. #define _INC_DIBAPI
  16.  
  17. /* Handle to a DIB */
  18. DECLARE_HANDLE(HDIB);
  19.  
  20. /* DIB constants */
  21. #define PALVERSION   0x300
  22.  
  23. /* DIB Macros*/
  24.  
  25. #define IS_WIN30_DIB(lpbi)  ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  26. #define RECTWIDTH(lpRect)     ((lpRect)->right - (lpRect)->left)
  27. #define RECTHEIGHT(lpRect)    ((lpRect)->bottom - (lpRect)->top)
  28.  
  29. // WIDTHBYTES performs DWORD-aligning of DIB scanlines.  The "bits"
  30. // parameter is the bit count for the scanline (biWidth * biBitCount),
  31. // and this macro returns the number of DWORD-aligned bytes needed
  32. // to hold those bits.
  33.  
  34. #define WIDTHBYTES(bits)    (((bits) + 31) / 32 * 4)
  35.  
  36. /* Function prototypes */
  37. BOOL      WINAPI  PaintDIB (HDC, LPRECT, HDIB, LPRECT, HPALETTE hPal);
  38. BOOL      WINAPI  CreateDIBPalette(HDIB hDIB, HPALETTE* pPal);
  39. LPSTR     WINAPI  FindDIBBits (LPSTR lpbi);
  40. DWORD     WINAPI  DIBWidth (LPSTR lpDIB);
  41. DWORD     WINAPI  DIBHeight (LPSTR lpDIB);
  42. WORD      WINAPI  PaletteSize (LPSTR lpbi);
  43. WORD      WINAPI  DIBNumColors (LPSTR lpbi);
  44. HGLOBAL   WINAPI  CopyHandle (HGLOBAL h);
  45.  
  46. HDIB      WINAPI  ReadDIBFile(LPCTSTR pszFileName);
  47.  
  48. #endif //!_INC_DIBAPI
  49.