1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef RENDER_HEAD_FILE
- #define RENDER_HEAD_FILE
- #pragma once
- #include <map>
- #include <vector>
- using namespace std;
- class CImageEx;
- struct tagImageInfo
- {
- CImageEx *pImage;
- int nRef;
- };
- class CRenderManager
- {
- protected:
- HFONT m_hDefaultFont;
- HINSTANCE m_hResInstance;
- map<LPCTSTR,tagImageInfo*> m_ArrayImage;
- vector<HFONT> m_ArrayFont;
- public:
- CRenderManager(void);
- ~CRenderManager(void);
-
- public:
- static CRenderManager*GetInstance();
-
- public:
- HFONT GetDeaultFont(){return m_hDefaultFont;}
- public:
-
- bool GetWorkDirectory(TCHAR szWorkDirectory[], WORD wBufferCount);
-
- void SetDefaultFont(LPCTSTR pStrFontName, int nSize, bool bBold, bool bUnderline, bool bItalic);
-
- void SetResInstance(HINSTANCE hInstance){m_hResInstance = hInstance;}
- public:
-
- void AddFont(LPCTSTR pStrFontName, int nSize, bool bBold=false, bool bUnderline=false, bool bItalic=false);
-
- HFONT GetFont(int nIndex);
-
- HFONT GetEndFont();
-
- public:
-
- CImageEx *GetImage(LPCTSTR lpszFileName,LPCTSTR lpszResType=NULL);
-
- void RemoveImage(CImageEx *&pImage);
-
- void ClearImage();
-
- public:
-
- void DrawColor(HDC hDC, const RECT& rc, COLORREF color);
-
- void DrawGradient(HDC hDC, const RECT& rc, DWORD dwFirst, DWORD dwSecond, bool bVertical, int nSteps);
-
- void DrawLine(HDC hDC, const RECT& rc, int nSize, COLORREF dwPenColor,int nStyle = PS_SOLID);
-
- void DrawRect(HDC hDC, const RECT& rc, int nSize, COLORREF dwPenColor);
-
- void DrawRoundRect(HDC hDC, const RECT& rc, int width, int height, int nSize, COLORREF dwPenColor);
-
- SIZE GetTextSize(HDC hDC, LPCTSTR pstrText, HFONT hFont, UINT uStyle);
- };
- #define RenderEngine CRenderManager::GetInstance()
- #endif
|