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

📄 designerview.h

📁 《数字图象工程案例》原码
💻 H
字号:
// DesignerView.h : interface of the CDesignerView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DESIGNERVIEW_H__5AEA15F9_CECB_44F6_B5CC_19CE7588A0A9__INCLUDED_)
#define AFX_DESIGNERVIEW_H__5AEA15F9_CECB_44F6_B5CC_19CE7588A0A9__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//#include"stdafx.h"
#include "MainFrm.h"
#include "DesignerDoc.h"
#include "EDGESELECT.h"
#include "TEXTRUE.h"
#include "BaseTexture.h"	// Added by ClassView
#include "DeleteScatter.h"



#include "DrawPicture.h"

// Added by ClassView
//#include "Designer.h"
#define EDGECOLOR RGB(127,128,129)
#define UNDOLENTH  5
#define MAXTRACKLENTH 100
typedef struct {
	CPoint m_Point1;
	CPoint m_Point2;
}UNDODATA;
typedef struct {
	SELECTMODE m_Undo_Mode_Stack[UNDOLENTH];
	UNDODATA   m_Undo_Data_Stack[UNDOLENTH];
	int m_CurrentP;
	//CPoint  m_Track[UNDOLENTH][MAXTRACKLENTH];
	//BYTE    m_Track_Overlap[UNDOLENTH][MAXTRACKLENTH];
	//BYTE    m_Track_Len[UNDOLENTH];
}UNDOSTRUCT;



enum orientmode {LEFT,UP,RIGHT,DOWN,UPPERRIGHT,UPPERLEFT,DOWNRIGHT,DOWNLEFT};

class CDesignerView : public CScrollView
{
protected: // create from serialization only
	CDesignerView();
	DECLARE_DYNCREATE(CDesignerView)

// Attributes
public:
	CDesignerDoc* GetDocument();

// Operations
public:

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



	
	bool  IsReduceColorUsable;
	bool  IsOtherPictureMenuUsable;
	bool  IsCutUsable;
	bool  IsPasteUsable;
	bool  IsCopyUsable;
	bool  IsDaohangqiUsable;

// Implementation
public:
	bool m_JudgeLab[LINENUM][LINENUM];
	bool RecursiveJudgeIsContinus(CPoint srcPoint,CPoint StartPoint,int *len);
	CPoint m_Rytx_Draw_CurrentPoint;
	CBrush m_CBRed,m_CBGreen,m_CBBlue,m_CBYellow,m_CBWhite;
	

///////////////////////////////////
	  //  autojiansi 
  // jiansizz

   // goubian
  
 
	void FillCurrGrid(CPoint currpoint);


	COLORREF m_gbbackcolor ;
	COLORREF m_gbcolor;
	

	bool m_brepeat;

	//gb prepoint;
	CPoint global_prep;

//////////////////////////////////
	void AntPasteColor(CDC *pDC,RECTSINFO PasteInfo,CPoint Scroll);
	void RecursiveJudge(int x,int y,bool coloredge[LINENUM][LINENUM],int *len);
	void AntCircle(CDC *pDC,RECTSINFO CircleInfo,CPoint Scroll,bool type);
	PICTURECOLOR m_BeiTiHuanColor;
	int m_PenWuQi_Num;
	int m_PenWuQi_Radius;
	CPoint RectLeftTop;
	CPoint RectRightBottom;
	CPoint m_Current_Mouse;
	CPoint m_scr_color_LT;
	CPoint m_scr_color_RB;
	bool bmpfirstload;
	RECTSINFO m_RectsInfo;
	RECTSINFO m_Circle_Scr;
	RECTSINFO m_Circle_Color_Scr;
	RECTSINFO m_Circle_Color_Current;
	RECTSINFO m_Paste_Scr;
	RECTSINFO m_Paste_Current;
	CBrush m_CBrushWG;

	int m_Delete_Scatter_Num;
	DELETESCATTERTYPE m_Delete_Scatter_Type;
	void AntRectang(CDC *pDC,CPoint Scroll);
	//void GetAllCoff(int *coff,int columntotalnumber,int steppatchgrid);
	bool m_ReduceColor;
	int m_Step_Line;
	CPoint m_LineNum;
	void RecersiveFill(CDC *pDC,CPoint pointbig,int curx,int cury,bool type);
	float m_weimi;
	float m_jingmi;
	int m_weinum;
	int m_jingnum;
	PICTURECOLOR m_picture_color[LINENUM][LINENUM];
	PICTURECOLOR m_picture_color2[LINENUM][LINENUM];
	PICTURECOLOR m_picture_color3[LINENUM][LINENUM];
	
	bool m_RenYTXLab[LINENUM][LINENUM];
	
	void ShowPict(CDC *pDC,int StepLen);
	void ShowPictEdge(CDC *pDC,int StepLen);
	int color[100];
	BOOL m_IsBoxFilled[LINENUM][LINENUM];
	int m_height;
	int m_width;
	BOOL m_Base_Create;
	int FillPicture(CDC *pDC,CPoint point,int curx,int cury);
	BOOL m_Fill_Picture;
	CPoint LocatePoint(CPoint);
	SELECTMODE m_DrawMode;
	bool m_picture_edge[LINENUM][LINENUM];
	int m_texture_type;
	float m_jwm;
	int m_jwlabel[MAXJW][MAXJW];
	BaseTexture   m_basetexture;
	
	


	UNDOSTRUCT m_UndoStruct;


	virtual ~CDesignerView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CDesignerView)

	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnMenuGyQuzadian();
	afx_msg void OnMenuPicReducecolor();
	afx_msg void OnMenuPicTuxpjShangx();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnMenuWgJianshaoV();
	afx_msg void OnToolbarPolygon();
	afx_msg void OnEditCut();
	afx_msg void OnEditCopy();
	afx_msg void OnEditPaste();

	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditReduceColor(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMenuGyQuzadian(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMenuPicReducecolor(CCmdUI* pCmdUI);
	afx_msg void OnCircle();
	afx_msg void OnJiangliwangge();
	afx_msg void OnPen();
	afx_msg void OnXiqu();
	afx_msg void OnZuzhi();
	afx_msg void OnOpenZuzhi();
	afx_msg void OnYouqitong();
	afx_msg void OnPenwuqi();
	afx_msg void OnRect();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void YouQiTong(CDC *pDC,CPoint CurrestPoint,CPoint Scroll,PICTURECOLOR pc,COLORREF color);
	BOOL IsInRYTX(CPoint loca);
	bool m_Is_WHDivide;
	int m_Num_Color;
	COLORREF m_Pen_Color;
	CPoint m_CircleCenter;
	bool m_largesmallmode;
	int  m_bmp_width ;
	int  m_bmp_height;
    int  m_old_bmp_width;
	int  m_old_bmp_height;


};

#ifndef _DEBUG  // debug version in DesignerView.cpp
inline CDesignerDoc* CDesignerView::GetDocument()
   { return (CDesignerDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_DESIGNERVIEW_H__5AEA15F9_CECB_44F6_B5CC_19CE7588A0A9__INCLUDED_)

⌨️ 快捷键说明

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