📄 drawview.h
字号:
// DrawView.h : interface of the CDrawView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_DRAWVIEW_H__5B3EEE8A_9530_4D68_93D0_D458F2691874__INCLUDED_)
#define AFX_DRAWVIEW_H__5B3EEE8A_9530_4D68_93D0_D458F2691874__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "Resource.h"
#include "Pedit.h"
class CDrawDoc;
class CUnit;
#include "SelectB.h"
#include "CDBigsmall.h"
extern int iScreenWidth,iScreenHeight;
extern HDC hMemDC;
const char Tool_NULL=0;
const char Tool_PEN=1;
const char Tool_LINE=2;
const char Tool_RECTANGLE=3;
const char Tool_ELLIPSE=4;
const char Tool_CHAR=5;
const char Tool_SEL=6;
const char Tool_BIGSMALL=7;
const char Tool_S_PEN=0;
const char Tool_S_BRUSH=1;
const char Tool_SEL_NULL=0;
const char Tool_SEL_TOP=1;
const char Tool_SEL_BOTTOM=2;
const char Tool_SEL_LEFT=3;
const char Tool_SEL_RIGHT=4;
const char Tool_SEL_CENTER=5;
const char CMD_LBDOWN=1;
const char CMD_LBUP=2;
const char CMD_LBMOVE=3;
struct Do_struct
{
int Cmd;
CPoint point;
};
class CDrawView : public CView
{
public: // 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);
virtual void OnInitialUpdate();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CDrawView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
public:
CPoint m_FirstPt,m_SecondPt; //第一个点
bool m_status; //是否处于画图状态
char m_tool_type; //所选工具
COLORREF m_BackgroundColor;
int m_BkMode;
char m_toolcolorFB; //所选:画笔与画刷
bool m_transparence; //透明
COLORREF m_CurPen; //当前画笔颜色
COLORREF m_CurBrush; //当前画刷颜色
int m_colorNO;
char m_CurPtSel; //SELECT控件时,所要调整的方向
CEdit edit1;
CSelectB SelectB;
CDBigsmall m_BigSmall;
HDC hScrDC;
CDC * pDC1;
Do_struct Do;
LPSTR g_lpDIB; //DIB图变量
CPoint m_FirstPoint;
CPoint m_SecondPoint;
CUnit *m_pCurrentUnit;
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CDrawView)
afx_msg void OnToolPen();
afx_msg void OnToolLine();
afx_msg void OnToolRectangle();
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnToolRed();
afx_msg void OnToolYellow();
afx_msg void OnToolBlue();
afx_msg void OnToolGreen();
afx_msg void OnToolFbc();
afx_msg void OnToolHred();
afx_msg void OnToolAmet();
afx_msg void OnToolFblue();
afx_msg void OnToolFgray();
afx_msg void OnToolFred();
afx_msg void OnToolGray();
afx_msg void OnToolHblue();
afx_msg void OnToolHgreen();
afx_msg void OnToolHyellow();
afx_msg void OnToolWhite();
afx_msg void OnToolWhiteblue();
afx_msg void OnToolBlack();
afx_msg void OnToolCdialog();
afx_msg void OnToolBc();
afx_msg void OnToolFc();
afx_msg void OnToolKrectangle();
afx_msg void OnToolKellipse();
afx_msg void OnToolEllipse();
afx_msg void OnToolChara();
afx_msg void OnToolPall();
afx_msg void OnToolPallk();
afx_msg void OnUpdateToolPen(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolChara(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolEllipse(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolLine(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolPall(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolPallk(CCmdUI* pCmdUI);
afx_msg void OnUpdateToolRectangle(CCmdUI* pCmdUI);
afx_msg void OnToolBSel();
afx_msg void OnToolBBig();
afx_msg void OnUpdateToolBBig(CCmdUI* pCmdUI);
afx_msg void OnFileOpen();
afx_msg void OnFileSave();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void DrawActive(CDC *pDC,CPoint point);
void DrawRectangleActive(CDC *pDC,CPoint point);
void DrawKRectangleActive(CDC *pDC,CPoint point);
void DrawEllipseActive(CDC *pDC,CPoint point);
void DrawKEllipseActive(CDC *pDC,CPoint point);
void DrawCharActive(CDC *pDC,CPoint point);
BOOL SaveDIB(CBitmap*pbitmap, CFile&file);
void GetScreen();
void OnToolChange();
BOOL SaveBitmapToFile(HBITMAP hBitmap , CString lpFileName) ;
//InPEdit* ShowInPlaceEdit(int iRowIndex, int iColumnIndex, CString& rstrCurSelection);
};
#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__5B3EEE8A_9530_4D68_93D0_D458F2691874__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -