⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ly16paintview.h

📁 简单的画笔程序 完全由自己编写的
💻 H
字号:
// LY16paintView.h : interface of the CLY16paintView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_LY16PAINTVIEW_H__0809956B_20D5_4596_A4D9_20F5232CEC50__INCLUDED_)
#define AFX_LY16PAINTVIEW_H__0809956B_20D5_4596_A4D9_20F5232CEC50__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CLY16paintView : public CView
{
protected: // create from serialization only
	CLY16paintView();
	DECLARE_DYNCREATE(CLY16paintView)

// Attributes
public:
	CLY16paintDoc* GetDocument();
	CPoint downPoint,upPoint;
	bool m_toolbarcheck,m_pointcheck;

// Operations
public:
		enum PAINTTYPE 
	{
		IRREG_SEL=0,
		RECT_SEL,
		ERASER,
		FILL,
		SEL_COLOR,
		MAGNIFY,
		PEN,
		BRUSH,
		AIRBRUSH,
		TEXT,
		LINE,
		CURVE,
		RECT,
		POLYGON,
		ELLIPSE,
		ROUND_RECT,
		OUTLINED_RECT,
		FILLED_RECT,
		OUTLINED_ELLIPSE,
		FILLED_ELLIPSE,
		OUTLINED_POLYGON,
		FILLED_POLYGON,
	};
	PAINTTYPE m_emPaintType;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CLY16paintView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	int GetRectType() const;
	void UpdateImage();
	void XorLine(CPoint pt1,CPoint pt2);
	void SetSelBox(int type);
	virtual ~CLY16paintView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
		CBitmap* m_pbmBackground;
		CDC* m_pdcMem;


// Generated message map functions
protected:
	COLORREF GetCanvasColor() const;
	COLORREF GetPaintColor() const;
	int GetPenWidth() const;
	//{{AFX_MSG(CLY16paintView)
	afx_msg void OnButtonPen();
	afx_msg void OnUpdateButtonPen(CCmdUI* pCmdUI);
	afx_msg void OnButtonAirbrush();
	afx_msg void OnUpdateButtonAirbrush(CCmdUI* pCmdUI);
	afx_msg void OnButtonBrush();
	afx_msg void OnUpdateButtonBrush(CCmdUI* pCmdUI);
	afx_msg void OnButtonCurve();
	afx_msg void OnUpdateButtonCurve(CCmdUI* pCmdUI);
	afx_msg void OnButtonEllipse();
	afx_msg void OnUpdateButtonEllipse(CCmdUI* pCmdUI);
	afx_msg void OnButtonEraser();
	afx_msg void OnUpdateButtonEraser(CCmdUI* pCmdUI);
	afx_msg void OnButtonFill();
	afx_msg void OnUpdateButtonFill(CCmdUI* pCmdUI);
	afx_msg void OnButtonIrregSel();
	afx_msg void OnUpdateButtonIrregSel(CCmdUI* pCmdUI);
	afx_msg void OnButtonLine();
	afx_msg void OnUpdateButtonLine(CCmdUI* pCmdUI);
	afx_msg void OnButtonMagnify();
	afx_msg void OnUpdateButtonMagnify(CCmdUI* pCmdUI);
	afx_msg void OnButtonPolygon();
	afx_msg void OnUpdateButtonPolygon(CCmdUI* pCmdUI);
	afx_msg void OnButtonRect();
	afx_msg void OnUpdateButtonRect(CCmdUI* pCmdUI);
	afx_msg void OnButtonRectSel();
	afx_msg void OnUpdateButtonRectSel(CCmdUI* pCmdUI);
	afx_msg void OnButtonRoundRect();
	afx_msg void OnUpdateButtonRoundRect(CCmdUI* pCmdUI);
	afx_msg void OnButtonSelcolor();
	afx_msg void OnUpdateButtonSelcolor(CCmdUI* pCmdUI);
	afx_msg void OnButtonText();
	afx_msg void OnUpdateButtonText(CCmdUI* pCmdUI);
	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
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in LY16paintView.cpp
inline CLY16paintDoc* CLY16paintView::GetDocument()
   { return (CLY16paintDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_LY16PAINTVIEW_H__0809956B_20D5_4596_A4D9_20F5232CEC50__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -