BSEImgFileMgr.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #pragma once
  2. #include "afx.h"
  3. #include "stdafx.h"
  4. #include "BSEImg.h"
  5. #include "OTSFileSys.h"
  6. #include "OTSHelper.h"
  7. #include "XMLSerialization.h"
  8. namespace OTSMODEL {
  9. using namespace OTSDATA;
  10. // BSE image file mark
  11. const int BSE_IMG_FILE_MARK = 'B' + 'S' + 'E' + 'I' + 'M' + 'G' ;
  12. // BSE image file version string
  13. const CString BSE_IMG_FILE_VERSION = _T("1.1.1");
  14. // BSE image
  15. const CString BSE_IMG_FILE_EXT = _T(".img");
  16. const CString BSE_IMG_FILE_FILTER = _T("BSE image Files (*.img)|*.img||");
  17. // bmp image
  18. const CString BMP_IMG_FILE_EXT = _T(".bmp");
  19. const CString BMP_IMG_FILE_FILTER = _T("Bitmap image Files (*.bmp)|*.bmp||");
  20. class __declspec(dllexport) CBSEImgFileMgr : public CObject, public xmls::ISlo
  21. {
  22. protected:
  23. //DECLARE_SERIAL(CBSEImgFileMgr)
  24. public:
  25. CBSEImgFileMgr();
  26. virtual ~CBSEImgFileMgr();
  27. // serialization
  28. //void Serialize(CArchive& ar);
  29. // Load/Save
  30. /*BOOL Load(CString a_strPathName = _T(""), BOOL a_bClear = TRUE);
  31. BOOL Save(CString a_strPathName = _T(""));*/
  32. // LoadFromBitmap
  33. BOOL LoadFromBitmap(CString a_strPathName = _T(""), BOOL a_bClear = TRUE);
  34. BOOL SaveIntoBitmap(CString a_strPathName = _T(""));
  35. // file pathname
  36. CString GetPathName() { return m_strPathName; }
  37. void SetPathName(CString a_strPathName) { m_strPathName = a_strPathName; }
  38. //image
  39. CBSEImgPtr GetBSEImg() { return m_poBSE; }
  40. void SetBSEImg(CBSEImgPtr a_poBSE);
  41. //void Serialize(bool isStoring, tinyxml2::XMLDocument * classDoc, tinyxml2::XMLElement * rootNode);
  42. protected:
  43. // cleanup
  44. //void Cleanup();
  45. //// initialization
  46. //void Init(int w,int h);
  47. //// duplication
  48. //void Duplicate(const CBSEImgFileMgr& a_oSource);
  49. // file pathname
  50. CString m_strPathName;
  51. // BSE image
  52. CBSEImgPtr m_poBSE;
  53. };
  54. typedef std::shared_ptr<CBSEImgFileMgr> __declspec(dllexport) CBSEImgFileMgrPtr;
  55. }