欢迎来到天天文库
浏览记录
ID:6380223
大小:195.00 KB
页数:26页
时间:2018-01-12
《简单画图板设计报告》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、简单画图板设计报告1.设计目的:设计一个能够自定义颜色;能够实现自定义字体的大小颜色并且输出到画图板上;能够实现简单的图形绘制(如:直线;矩形;椭圆;圆角矩形等);能够实现铅笔功能来实现连续画线;能够实现自定义线宽和自定义线型;能够实现画刷和局部填充颜色;能够实现实现清屏功能和计时的附加功能。2.总体设计:简单画图板图形直线矩形椭圆铅笔画线圆角矩形饼图线宽线宽为2线宽为3线宽为5自定义线宽颜色红蓝绿自定义颜色线型自定义线型画刷文字调用文字附加功能清屏秒表3详细设计:CMyView颜色类型:COLORREF;
2、线宽类型:int;线型类型:int;坐标点类型:CPOINT;输出字体类型:Cstring;voidCMyView::OnDelete();voidCMyView::OnDline();voidCMyView::OnDraw(CDC*pDC);voidCMyView::OnEllipse();voidCMyView::OnFillcolor();voidCMyView::OnLButtonDown(UINTnFlags,Cpointpoint);voidCMyView::OnLButtonUp(UINTnF
3、lags,CPointpoint);voidCMyView::OnLine();voidCMyView::OnMouseMove(UINTnFlags,CPointpoint);voidCMyView::OnMyfont();voidCMyView::OnPie();voidCMyView::OnRectangle();voidCMyView::OnRoundrectangle();voidCMyView::OnUserdefined();voidCMyView::OnUserdefinedbrush();
4、voidCMyView::OnUserdifinedColor();voidCMyView::OnUserdifinedLinewidth();BOOLCMyView::PreCreateWindow(CREATESTRUCT&cs);MYFONT颜色类型:COLORREF;颜色列表:CListBox编辑框变量:Cstring类型选择列表:int;voidMYFONT::OnCancelMode();voidMYFONT::OnChangeDataEdit();voidMYFONT::OnExitButto
5、n();BOOLMYFONT::OnInitDialog();voidMYFONT::OnPaint();voidMYFONT::OnRadio();voidMYFONT::OnSetButton();CtimerDlg时间变量:int;时间变量m_nTimer:UINT;传递变量m_timer:Cstring;CTimerDlg::CTimerDlg(CWnd*pParent)CDialog(CTimerDlg::IDD,pParent);voidCTimerDlg::DoDataExchange(CDa
6、taExchange*pDX);voidCTimerDlg::OnBeginTime();voidCTimerDlg::OnCancle();voidCTimerDlg::OnEndTime();voidCTimerDlg::OnTimer(UINTnIDEvent);父类ClineWidthCLineWidth::CLineWidth(CWnd*pParent)CDialog(CLineWidth::IDD,pParent);voidCLineWidth::DoDataExchange(CDataExch
7、ange*pDX);voidCLineWidth::OnOK;ClineStyleCLineStyle::CLineStyle(CWnd*pParent)CDialog(CLineStyle::IDD,pParent);voidCLineStyle::DoDataExchange(CDataExchange*pDX);voidCLineStyle::OnCancel();voidCLineStyle::OnLinestyle();voidCLineStyle::OnOK();4测试过程:先进行了基本图形的绘
8、制,然后测试图形的颜色,线宽,线型,画刷填充,文字显示,位图载入,上述功能基本都能实现。最后测试清屏,橡皮图形重绘等功能,遇到了一些问题。测试遇到问题:1.窗口不能重绘。2.清屏后不能重绘。解决问题方法:1.在OnDraw函数中加入一个Point数组,把已经画过的保存起来。2.将画图选择变量select设-1,调用Invalidate();这样在清屏后还可调用OnDraw函数进行画图。5源程序清单和执行结果:[1
此文档下载收益归作者所有