dibapi.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // dibapi.h
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1995 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. #ifndef _INC_DIBAPI
  13. #define _INC_DIBAPI
  14. class CPalette;
  15. #include "HDib.h" // Handle to a DIB
  16. /* DIB constants */
  17. #define PALVERSION 0x300
  18. /* DIB Macros*/
  19. #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  20. #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
  21. #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
  22. // WIDTHBYTES performs DWORD-aligning of DIB scanlines. The "bits"
  23. // parameter is the bit count for the scanline (biWidth * biBitCount),
  24. // and this macro returns the number of DWORD-aligned bytes needed
  25. // to hold those bits.
  26. #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
  27. /* Function prototypes */
  28. // Note: Many of these functions are using LPSTR where they should really be
  29. // LPBITMAPINFOHEADERs or BYTE*s etc. I've only changed the ones I'm using.
  30. BOOL WINAPI PaintDIB (HDC, LPRECT, HDIB, LPRECT, CPalette* pPal);
  31. BOOL WINAPI CreateDIBPalette(HDIB hDIB, CPalette* cPal);
  32. BYTE* WINAPI FindDIBBits (LPBITMAPINFOHEADER lpbi);
  33. DWORD WINAPI DIBWidth (LPSTR lpDIB);
  34. DWORD WINAPI DIBHeight (LPSTR lpDIB);
  35. WORD WINAPI PaletteSize (LPBITMAPINFOHEADER lpbi);
  36. WORD WINAPI DIBNumColors(LPBITMAPINFOHEADER lpbi);
  37. HGLOBAL WINAPI CopyHandle (HGLOBAL h);
  38. BOOL WINAPI SaveDIB (HDIB hDib, CFile& file);
  39. HDIB WINAPI ReadDIBFile(CFile& file);
  40. #endif //!_INC_DIBAPI