1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- // dibapi.h
- //
- // This is a part of the Microsoft Foundation Classes C++ library.
- // Copyright (C) 1992-1995 Microsoft Corporation
- // All rights reserved.
- //
- // This source code is only intended as a supplement to the
- // Microsoft Foundation Classes Reference and related
- // electronic documentation provided with the library.
- // See these sources for detailed information regarding the
- // Microsoft Foundation Classes product.
- #ifndef _INC_DIBAPI
- #define _INC_DIBAPI
- class CPalette;
- #include "HDib.h" // Handle to a DIB
- /* DIB constants */
- #define PALVERSION 0x300
- /* DIB Macros*/
- #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
- #define RECTWIDTH(lpRect) ((lpRect)->right - (lpRect)->left)
- #define RECTHEIGHT(lpRect) ((lpRect)->bottom - (lpRect)->top)
- // WIDTHBYTES performs DWORD-aligning of DIB scanlines. The "bits"
- // parameter is the bit count for the scanline (biWidth * biBitCount),
- // and this macro returns the number of DWORD-aligned bytes needed
- // to hold those bits.
- #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
- /* Function prototypes */
- // Note: Many of these functions are using LPSTR where they should really be
- // LPBITMAPINFOHEADERs or BYTE*s etc. I've only changed the ones I'm using.
- BOOL WINAPI PaintDIB (HDC, LPRECT, HDIB, LPRECT, CPalette* pPal);
- BOOL WINAPI CreateDIBPalette(HDIB hDIB, CPalette* cPal);
- BYTE* WINAPI FindDIBBits (LPBITMAPINFOHEADER lpbi);
- DWORD WINAPI DIBWidth (LPSTR lpDIB);
- DWORD WINAPI DIBHeight (LPSTR lpDIB);
- WORD WINAPI PaletteSize (LPBITMAPINFOHEADER lpbi);
- WORD WINAPI DIBNumColors(LPBITMAPINFOHEADER lpbi);
- HGLOBAL WINAPI CopyHandle (HGLOBAL h);
- BOOL WINAPI SaveDIB (HDIB hDib, CFile& file);
- HDIB WINAPI ReadDIBFile(CFile& file);
- #endif //!_INC_DIBAPI
|