📄 drawview.h
字号:
// DrawView.h : interface of the CDrawView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DRAWVIEW_H__7721C07C_C26E_4590_BA02_ED3ED094C895__INCLUDED_)
#define AFX_DRAWVIEW_H__7721C07C_C26E_4590_BA02_ED3ED094C895__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
//#include <atlimage.h>
#include <comdef.h>
#include "structrue.h"
class CDrawView : public CView
{
protected: // create from serialization only
CDrawView();
DECLARE_DYNCREATE(CDrawView)
// Attributes
public:
CDrawDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDrawView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
//}}AFX_VIRTUAL
// Implementation
public:
HBITMAP CanvasToBmp();
void RecordHistory();
void InitHistory(HBITMAP bmp);
void setSize();
int m_var;
int paint;
bool b1;
int redo;
int undo;
Stack *m_pHistoryStack;
HBITMAP m_hBitmap;
int bmpstate;
CString BmpName; //保存图像文件文件名
CString extname; //保存图像文件扩展名
CBitmap m_bitmap; //创建位图对象
void ShowBitmap(CDC* pDC,CString BmpName);
CDC *m_memDC; // virtual window device con text
CDC m_redoDC; // virtual window device context
CDC m_undoDC; // virtual window device context
CBitmap m_bmp; // virtual window bitmap
// CBitmap m_undobmp; // virtual window bitmap
// CBitmap m_redobmp; // virtual window bitmap
CBrush m_bkbrush; // brush for virtual window
// CImage m_imgCurent;
CBrush m_RedBrush, m_YellowBrush, m_GreenBrush, m_BlueBrush, m_BlackBrush;
CBrush m_OldBrush;
CBrush HollowBrush;
CBrush m_CustomBK;
CBrush m_PreviousBrush, m_CurrentBrush;
CPen m_RedPen, m_YellowPen, m_GreenPen, m_BluePen;
CPen m_OldPen, m_CustPen;
CPen m_CurrentPen;
COLORREF fillCol;
COLORREF newCol;
COLORREF bgCol;
COLORREF corCol;
CPoint m_OldPoint,m_CurrentPoint;
virtual ~CDrawView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDrawView)
afx_msg void OnCurve();
afx_msg void OnFillCircle();
afx_msg void OnFillRect();
afx_msg void OnFillRoundrect();
afx_msg void OnHollowCircle();
afx_msg void OnHollowRect();
afx_msg void Online();
afx_msg void OnHallowRoundrect();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnReset();
afx_msg void OnEraser();
afx_msg void OnFileOpen();
afx_msg void OnBlackbrush();
afx_msg void OnBluebrush();
afx_msg void OnCustomBrush();
afx_msg void OnGreenbrush();
afx_msg void OnRedbrush();
afx_msg void OnWhitebrush();
afx_msg void OnYellowbrush();
afx_msg void OnBlackpen();
afx_msg void OnBluepen();
afx_msg void OnCustomPen();
afx_msg void OnGreenpen();
afx_msg void OnRedpen();
afx_msg void OnYellowpen();
afx_msg void OnOne();
afx_msg void OnTwo();
afx_msg void OnThree();
afx_msg void OnCustomSize();
afx_msg void OnFileSave();
afx_msg void OnEditRedo();
afx_msg void OnEditUndo();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in DrawView.cpp
inline CDrawDoc* CDrawView::GetDocument()
{ return (CDrawDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft eMbedded Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DRAWVIEW_H__7721C07C_C26E_4590_BA02_ED3ED094C895__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -