00001 #ifndef DIB_API
00002 #define DIB_API
00003
00004 #include "dibclass.h"
00005
00006 // LOGPALETTE's version number.
00007 #define PALVERSION 0x300
00008
00009 // WIDTHBYTES takes # of bits in a scan line and rounds up to nearest
00010 // word.
00011 #define WIDTHBYTES(bits) (((bits) + 31) / 32 * 4)
00012
00013 // Given a pointer to a DIB header, return TRUE if is a Windows 3.x
00014 // DIB, false if otherwise (PM style DIB).
00015 #define IS_WIN3x_DIB(lpbi) ((BOOL)((*(LPDWORD) (lpbi)) == sizeof (BITMAPINFOHEADER)))
00016
00017 // Given a pointer to a DIB header, return TRUE if is an OS/2 PM
00018 // DIB, false if otherwise (Windows 3.x style DIB).
00019 #define IS_OS2PM_DIB(lpbi) ((BOOL)((*(LPDWORD) (lpbi)) == sizeof (BITMAPCOREHEADER)))
00020
00021 // Public Functions
00022 extern WORD DIBNumColors(LPSTR lpbi);
00023 extern HPALETTE RealizeDIBPalette(HDC hDC, HANDLE hDIB);
00024 extern LPSTR FindDIBBits(LPSTR lpbi);
00025 extern WORD PaletteSize(LPSTR lpbi);
00026 extern HPALETTE CreateDIBPalette(HANDLE hDIB);
00027 extern DWORD DIBHeight(LPSTR lpDIB);
00028 extern DWORD DIBWidth(LPSTR lpDIB);
00029
00030 // DIBBlt()
00031 BOOL DIBBlt(HDC hDC,
00032 int xDst,
00033 int yDst,
00034 int nWidth,
00035 int nHeight,
00036 HANDLE hDIB,
00037 int xSrc,
00038 int ySrc,
00039 DWORD dwROP);
00040
00041 // PaintDIBInBands()
00042 void PaintDIBInBands(HDC hDC,
00043 HANDLE hDIB,
00044 int nDIBWidth,
00045 int nDIBHeight,
00046 int nBandHeight);
00047
00048 // DIBToDDB()
00049 HBITMAP DIBToDDB(HANDLE hDIB,
00050 HPALETTE hPal);
00051
00052 BOOL AddDIBToListBox(HWND hList,
00053 LPSTR myStr,
00054 DIB * pBmp);
00055
00056 void RemoveListBoxDIBs(HWND hList);
00057
00058 #endif