BitmapHelper.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. // BitmapHelper.h: interface for the CBitmapHelper class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_)
  5. #define AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #define IS_WIN30_DIB(lpbi) ((*(LPDWORD)(lpbi)) == sizeof(BITMAPINFOHEADER))
  10. class CBitmapHelper
  11. {
  12. public:
  13. CBitmapHelper();
  14. virtual ~CBitmapHelper();
  15. static int GetCBitmapWidth(const CBitmap & cbm);
  16. static int GetCBitmapHeight(const CBitmap & cbm);
  17. static BOOL GetCBitmap(void *pClip2, CDC *pDC, CBitmap *pBitMap, int nMaxHeight);
  18. static HANDLE hBitmapToDIB(HBITMAP hBitmap, DWORD dwCompression, HPALETTE hPal);
  19. static WORD PaletteSize(LPSTR lpDIB);
  20. static WORD DIBNumColors(LPSTR lpDIB);
  21. static bool DrawDIB(CDC *pDC, HANDLE hData, int nLeft, int nRight, int &nWidth);
  22. };
  23. #endif // !defined(AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_)