#0245 {
#0246 // If the point lies outside of the accumulated bounding
#0247 // rectangle; then inflate the bounding rect to include it。
#0248 pt = m_pointArray'i';
#0249 m_rectBounding。left = min(m_rectBounding。left; pt。x);
#0250 m_rectBounding。right = max(m_rectBounding。right; pt。x);
#0251 m_rectBounding。top = max(m_rectBounding。top; pt。y);
#0252 m_rectBounding。bottom = min(m_rectBounding。bottom; pt。y);
#0253 }
#0254
#0255 // Add the pen width to the bounding rectangle。 This is necessary
#0256 // to account for the width of the stroke when invalidating
#0257 // the screen。
#0258 m_rectBounding。InflateRect(CSize(m_nPenWidth; …(int)m_nPenWidth));
#0259 return;
#0260 }
892
…………………………………………………………Page 955……………………………………………………………
附錄B Scribble Step5 完整原始碼
SCRIBBLEVIEW。H
#0001 class CScribbleView : public CScrollView
#0002 {
#0003 protected: // create from serialization only
#0004 CScribbleView();
#0005 DECLARE_DYNCREATE(CScribbleView)
#0006
#0007 // Attributes
#0008 public:
#0009 CScribbleDoc* GetDocument();
#0010
#0011 protected:
#0012 CStroke* m_pStrokeCur; // the stroke in progress
#0013 CPoint m_ptPrev; // the last mouse pt in the stroke in progress
#0014
#0015 // Operations
#0016 public:
#0017
#0018 // Overrides
#0019 // ClassWizard generated virtual function overrides
#0020 //{{AFX_VIRTUAL(CScribbleView)
#0021 public:
#0022 virtual void OnDraw(CDC* pDC); // overridden to draw this view
#0023 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
#0024 virtual void OnInitialUpdate();
#0025 protected:
#0026 virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
#0027 virtual void OnBeginPrinting(CDC* pDC; CPrintInfo* pInfo);
#0028 virtual void OnEndPrinting(CDC* pDC; CPrintInfo* pInfo);
#0029 virtual void OnUpdate(CView* pSender; LPARAM lHint; CObject* pHint);
#0030 virtual void OnPrint(CDC* pDC; CPrintInfo* pInfo);
#0031 //}}AFX_VIRTUAL
#0032
#0033 // Implementation
#0034 public:
#0035 void PrintTitlePage(CDC* pDC; CPrintInfo* pInfo);
#0036 void PrintPageHeader(CDC* pDC; CPrintInfo* pInfo; CString& strHeader);
#0037 virtual ~CScribbleView();
#0038 #ifdef _DEBUG
#0039 virtual void AssertValid() const;
#0040 virtual void Dump(CDumpContext& dc) const;
#0041 #endif
#0042
#0043 protected:
#0044
893
…………………………………………………………Page 956……………………………………………………………
第五篇 附錄
#0045 // Generated message map functions
#0046 protected:
#0047 //{{AFX_MSG(CScribbleView)
#0048 afx_msg void OnLButtonDown(UINT nFlags; CPoint point);
#0049 afx_msg void OnLButtonUp(UINT nFlags; CPoint point);
#0050 afx_msg void OnMouseMove(UINT nFlags; CPoint point);
#0051 //}}AFX_MSG
#0052 DECLARE_MESSAGE_MAP()
#0053 };
#0054
#0055 #ifndef _DEBUG // debug version in ScribVw。cpp
#0056 inline CScribbleDoc* CScribbleView::GetDocument()
#0057 { return (CScribbleDoc*)m_pDocument; }
#0058 #endif
SCRIBBLEVIEW。CPP
#0001 #include 〃stdafx。h〃
#0002 #include 〃Scribble。h〃
#0003
#0004 #include 〃ScribDoc。h〃
#0005 #include 〃ScribVw。h〃
#0006
#0007 #ifdef _DEBUG
#0008 #define new DEBUG_NEW
#0009 #undef THIS_FILE
#0010 static char THIS_FILE'' = __FILE__;
#0011 #endif
#0012
#0013 /////////////////////////////////////////////////////////////////
#0014 // CScribbleView
#0015
#0016 IMPLEMENT_DYNCREATE(CScribbleView; CScrollView)
#0017
#0018 BEGIN_MESSAGE_MAP(CScribbleView; CScrollView)
#0019 //{{AFX_MSG_MAP(CScribbleView)
#0020 ON_WM_LBUTTONDOWN()
#0021 ON_WM_LBUTTONUP()
#0022 ON_WM_MOUSEMOVE()
#0023 //}}AFX_MSG_MAP
#0024 // Standard printing mands
#0025 ON_MAND(ID_FILE_PRINT; CView::OnFilePrint)
#0026 ON_MAND(ID_FILE_PRINT_DIRECT; CView::OnFilePrint)
#0027 ON_MAND(ID_FILE_PRINT_PREVIEW; CView::OnFilePrintPreview)
#0028 END_MESSAGE_MAP()
#0029
894
…………………………………………………………Page 957……………………………………………………………
附錄B Scribble Step5 完整原始碼
#0030 //////////////////////////////////////////
小说推荐
- Java编程思想第4版[中文版](PDF格式)
- -Page 1-Page 2《Thinking In Java》中文版作者:Bruce Eckel主页:http/BruceEckel.编译:Trans Bot主页:http/memberease~transbot致谢-献给那些直到现在仍在孜孜不倦创造下一代计算机语言的人们!指导您利用万维网的语言进
- 最新章:第295章
- VB2008从入门到精通(PDF格式英文版)
- -Page 1(R)The eXperT’s Voice inBeginningVB 2008From Novice to ProfessionalChristian Gross-Page 2-Page 3-Beginning VB 2008From Novice to Professional■C
- 最新章:第214章
- oracle从入门到精通(PDF格式)
- -Page 1-Oracle 从入门到精通-Page 2-资源来自网络,仅供学习 Oracle 从入门到精通一、SQL 8
- 最新章:第37章
- C语言游戏编程从入门到精通(PDF格式)
- -Page 1-Page 2-Page 3-Page 4-Page 5-Page 6-Page 7-Page 8-Page 9-Page 10-Page 11-Page 12-Page 13-Page 14
- 最新章:第4章
- 深入浅出
- 《深入浅出》作者:白小骨晋江VIP20140610完结+1番外非V章节总点击数:67370 总书评数:209 当前被收藏数:764 文章积分:11,386,657文案:每个前男友都是女人掉过的坑,从何典阳这个坑里往外爬的梁温暖一脸血表示,何典阳他这个深坑实在太坑爹。何典阳:我是坑?梁温暖…别看我,我
- 最新章:第74章
- 深入浅出[娱乐圈]
- 文案【忠犬影帝攻X傲娇明星受,1V1轻松甜文,前期互相试探,38章在一起后甜甜甜,两人都有细微的变化和成长~这也是我用心构思攻受感情发展的文,但数据有点太惨了,没入V可以全文免费看,还是想求点收藏呀,数据好看点吧,让我开心一下(笑哭.jpg)流量偶像白漾和影帝顾瑜祁关系很僵,传言两人出道时不合而互相
- 最新章:第59章
- JMS简明教程(PDF格式)
- -Page 1-JMS1.1规范中文版卫建军2007‐11‐22-Page 2
- 最新章:第28章
- SQL语言艺术(PDF格式)
- -Page 1-SQLSSQQLL语言艺术内容介绍本书分为12章,每一章包含许多原则或准则,并通过举例的方式对原则进行解释说明。这些例子大多来自于实际案例,对九种SQL经典查询场景以及其性能影响讨论,非常便于实践,为你数据库应用维护人员阅读。资深 SQL 专家 Stéphane Faroult倾力打
- 最新章:第27章
- C语言实例教程(PDF格式)
- -Page 1-前 言Visual C+是开发运行于Windows 95和Windows NT环境下的Win32应用程序的可视化编程工具中最重要的成员之一,它为软件开发人员提供了完整的编辑、编译和调试工具和建立于Win32 API(ApplicationProgramming Interface)基
- 最新章:第143章