0 坏境下,用mfc 编写的绘制3 次Bezier 曲线的完整代码,其功能为:单击左键绘制控制多边形和坐标点,单击右键绘制曲线
具体操作步骤如下: (1)新建 mfc,工程名为Bezier
(2)编辑菜单资源并添加消息处理函数 OnBezier
(3)在工程主文件中编写代码如下(红色字体为要添加代码)
// BezierView
cpp : implementation of the CBezierView class // #include "stdafx
h" #include "Bezier
h" #include "BezierDoc
h" #include "BezierView
h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #define T 20 #endif ///////////////////////////////////////////////////////////////////////////// // CBezierView IMPLEMENT_DYNCREATE(CBezierView, CView) BEGIN_MESSAGE_MAP(CBezierView, CView) //{{AFX_MSG_MAP(CBezierView) // NOTE - the ClassWizard will add and remove mapping macros here
// DO NOT EDIT what you see in these blocks of generated code
ON_WM_RBUTTONDOWN() ON_WM_LBUTTONDOWN() //}}AFX_MS