Dib.h 952 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Dib.h: interface for the CDib class.
  2. // Download by http://www.NewXing.com
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_DIB_H_INCLUDED_)
  5. #define AFX_DIB_H_INCLUDED_
  6. #if _MSC_VER >= 1000
  7. #pragma once
  8. #endif // _MSC_VER >= 1000
  9. #include <vfw.h>
  10. #pragma comment(lib,"vfw32.lib")
  11. class CDib : public CObject
  12. {
  13. public:
  14. CDib();
  15. virtual ~CDib();
  16. //Attributes
  17. public:
  18. BYTE *GetBits();
  19. CSize GetSize();
  20. LONG GetWidth();
  21. LONG GetHeight();
  22. int GetBiBitCount();
  23. BOOL IsValid() { return(m_hDrawDib!=NULL); }
  24. operator HDRAWDIB() { return m_hDrawDib; }
  25. //operations
  26. public:
  27. BOOL Open(const char *pzFileName);
  28. BOOL Save(const char *pzFileName);
  29. void Draw(CDC *pDC,int nWidth, int nHeight);
  30. void Close();
  31. //public parameters
  32. BYTE *m_pDibBits;
  33. //implementation
  34. public:
  35. BYTE *m_pDib;
  36. HDRAWDIB m_hDrawDib;
  37. BITMAPFILEHEADER bmpFileHeader;
  38. };
  39. #endif // !defined(AFX_DIB_H_INCLUDED_)