You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
3.2 KiB
C

1 month ago
#pragma once
#include <Gdiplus.h>
class AFX_EXT_CLASS CXyDCBase :
public CSXY
{
public:
CXyDCBase(void);
virtual ~CXyDCBase(void);
public:
virtual int Create(CDC* pDC, BOOL bSetViewRect = TRUE);
virtual void Clear(void);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶԳ<C9B6><D4B3><EFBFBD>
virtual int CreatePenOrBrush(double PenWidth, COLORREF color, int type, BOOL bSmooth, BOOL bCreate);
virtual void CreateSelectPen(double PenWidth, COLORREF color, int type, UINT nStyle=PS_ENDCAP_FLAT|PS_JOIN_MITER, BOOL bSmooth=TRUE);
virtual BOOL CreateSelectBrush(COLORREF color, int type);
void RestorePen(); //<2F>ָ<EFBFBD>DC<44>е<EFBFBD>Pen
void RestoreBrush(); //<2F>ָ<EFBFBD>DC<44>е<EFBFBD>Brush
void SelectPen(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Penѡ<6E><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>DC<44><43>
void SelectBrush(); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Burshѡ<68><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>DC<44><43>
virtual void DeletePen(void); //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Pen
virtual void DeleteBrush(void); //ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɵ<EFBFBD>Brush
void RestorePenPlus(); //<2F>ָ<EFBFBD>DC<44>е<EFBFBD>Pen
void RestoreBrushPlus(); //<2F>ָ<EFBFBD>DC<44>е<EFBFBD>Brush
//void SelectPenPlus();
virtual void SetCurrentLayer(LPCTSTR strLayer); //Ϊ<><CEAA><EFBFBD><EFBFBD>չ<EFBFBD>ã<EFBFBD><C3A3>ڸ<EFBFBD><DAB8><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD><C3BB><EFBFBD>õ<EFBFBD><C3B5><EFBFBD><EFBFBD><EFBFBD>CDxfDC<44><43><EFBFBD>õ<EFBFBD>
virtual void SetCurrentColor(COLORREF colValue);
virtual COLORREF GetCurrentColor();
virtual void SetCurrentPenWidth(double penWidth);
virtual COLORREF GetCurrentBrushColor();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɶԳ<C9B6><D4B3><EFBFBD>
virtual BOOL CreateSelectFontRange(LOGFONT& lf);
virtual BOOL CreateSelectFontDraw(LOGFONT& lf);
void RestoreFont();
void SelectFontRange();
void SelectFontDraw();
void DeleteFontRange(void);
void DeleteFontDraw(void);
void operator=(CXyDCBase& dc);
void SetNullBrush(); //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ˢ<EFBFBD><CBA2>
void SetBlackPen(); //<2F><><EFBFBD><EFBFBD>Ϊ<EFBFBD>ڱ<EFBFBD>
private:
void CreatePen(int nPenWidth, COLORREF crColor, int type, UINT nStyle=PS_ENDCAP_FLAT|PS_JOIN_MITER, BOOL bSmooth=TRUE);
BOOL CreateBrush(COLORREF color, int type);
void CreatePenPlus();
void CreateBrushPlus();
public:
bool m_gdiplusInitialized = false;
Gdiplus::Pen m_penPlus;
Gdiplus::SolidBrush m_brushPlus;
COLORREF m_symbolBackcolor = 16777216;
COLORREF m_symbolForecolor = 16777216;
protected:
CPen m_pen;
CBrush m_brush;
int m_nPenRes;
int m_nBrushRes;
CPen* m_pOldPen;
CBrush* m_pOldBrush;
int oldRop2;
LOGFONT m_logFontRange;
LOGFONT m_logFontDraw;
CFont m_fontRange;
CFont m_fontDraw;
CFont* m_pOldFont;
private:
//ˢ<>ӻ򻭱ʵIJ<CAB5><C4B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
COLORREF m_brushColor;
int m_brushType;
COLORREF m_brushColorOld;
int m_brushTypeOld { 0 };
COLORREF m_penColor;
int m_penWidth;
int m_penType;
UINT m_penStyle;
BOOL m_penSmooth;
COLORREF m_penColorOld;
int m_penWidthOld{ 1 };
int m_penTypeOld { 0 };
UINT m_penStyleOld;
BOOL m_penSmoothOld;
public:
virtual int CreatePenOrBrush1(double PenWidth, COLORREF color, int type, BOOL bSmooth, BOOL bCreate, int nStyleCount = 0, DWORD* lpStyle = NULL); //ggff2025
virtual void CreateSelectPen1(double PenWidth, COLORREF color, int type, UINT nStyle = PS_ENDCAP_FLAT | PS_JOIN_MITER, BOOL bSmooth = TRUE, int nStyleCount = 0, DWORD* lpStyle = NULL); //ggff2025
private:
void CreatePen1(int nPenWidth, COLORREF crColor, int type, UINT nStyle = PS_ENDCAP_FLAT | PS_JOIN_MITER, BOOL bSmooth = TRUE, int nStyleCount = 0, DWORD* lpStyle = NULL);
int m_penStyleCount; //ggff2025
DWORD* m_penLpStyle; //ggff2025
};