BitmapHelper.h 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. #include "clip.h"
  11. class CBitmapHelper
  12. {
  13. public:
  14. CBitmapHelper();
  15. virtual ~CBitmapHelper();
  16. static int GetCBitmapWidth(const CBitmap& cbm);
  17. static int GetCBitmapHeight(const CBitmap& cbm);
  18. static BOOL GetCBitmap(void* pClip2, CDC* pDC, CBitmap* pBitMap, int nMaxHeight);
  19. static BOOL GetCBitmap(CClipFormats& clips, CDC* pDC, CBitmap* pBitMap, BOOL horizontal);
  20. static HANDLE hBitmapToDIB(HBITMAP hBitmap, DWORD dwCompression, HPALETTE hPal);
  21. static WORD PaletteSize(LPSTR lpDIB);
  22. static WORD DIBNumColors(LPSTR lpDIB);
  23. static bool DrawDIB(CDC* pDC, HANDLE hData, int nLeft, int nRight, int& nWidth);
  24. };
  25. #endif // !defined(AFX_BITMAPHELPER_H__641D941B_5487_4F85_BFC1_012F2083A8B6__INCLUDED_)