else //通过八个点,怎么什么连点方法实现图中形状?
{
CPen penBorder(PS_SOLID,1,RGB(255,0,255));
POINT pts[8];
CRect rc(0,24,158,231);
pts[0].x = rc.left;
pts[0].y = rc.bottom;
pts[1].x = rc.left + 2;
pts[1].y = rc.bottom - 50;
pts[2].x = rc.left + MAX -2;
pts[2].y = rc.top + 2;
pts[3].x = rc.left + MAX + 3;
pts[3].y = rc.top;
pts[4].x = rc.right -3;
pts[4].y = rc.top;
pts[5].x = rc.right - 1;
pts[5].y = rc.top + 2;
pts[6].x = rc.right -1;
pts[6].y = rc.bottom;
pts[7].x = rc.right -1;
pts[7].y = rc.bottom;
dc.Polyline(pts,8);
CDialogEx::OnPaint();
}
{
CPen penBorder(PS_SOLID,1,RGB(255,0,255));
POINT pts[8];
CRect rc(0,24,158,231);
pts[0].x = rc.left;
pts[0].y = rc.bottom;
pts[1].x = rc.left + 2;
pts[1].y = rc.bottom - 50;
pts[2].x = rc.left + MAX -2;
pts[2].y = rc.top + 2;
pts[3].x = rc.left + MAX + 3;
pts[3].y = rc.top;
pts[4].x = rc.right -3;
pts[4].y = rc.top;
pts[5].x = rc.right - 1;
pts[5].y = rc.top + 2;
pts[6].x = rc.right -1;
pts[6].y = rc.bottom;
pts[7].x = rc.right -1;
pts[7].y = rc.bottom;
dc.Polyline(pts,8);
CDialogEx::OnPaint();
}
解决方案 »
- 一整就死循环 但有时还会正常 求代码优化
- 我在winCE里面可以这样使用CreateFile吗
- 谁用过NTgraph控件,如何添加一个滚动条来控制图象?
- 为什么用new申请的内存块delete时出错?
- 编程中经常会遇到的一些问题
- 求 <远程控制编程技术> 这本书的附带源代码!!
- 怎样通过Button控件的HWND判断Button类型??把按钮和Radio和Group box区分开。
- @@@ 急~~~~~~~! 如何用钩子截获文本和图片的ole拖动事件 up有分 @@@
- 发贴感谢kingcom_xu和所有的兄弟们,大家随便拿吧(JennyVenus)
- 怎样编程删除 U盘免疫文件夹里面的特殊文件夹
- 我想把我的程序用到的库都放到一起怎么做~?
- 招聘开发人员
{
// CDialog::OnPaint();
#define MAX 20
CPaintDC dc(this); // device context for painting
CPen penBorder(PS_SOLID,1,RGB(255,0,255));
POINT pts[8];
CRect rc(0,24,158,231);
pts[0].x = rc.left;
pts[0].y = rc.bottom;
dc.TextOut(pts[0].x,pts[0].y,"0",1);
pts[1].x = rc.left + 2;
pts[1].y = rc.bottom - 50;
dc.TextOut(pts[1].x,pts[1].y,"1",1);
pts[2].x = rc.left + MAX -2;
pts[2].y = rc.top + 2;
dc.TextOut(pts[2].x-10,pts[2].y,"2",1);
pts[3].x = rc.left + MAX + 3;
pts[3].y = rc.top;
dc.TextOut(pts[3].x,pts[3].y,"3",1);
pts[4].x = rc.right -3;
pts[4].y = rc.top;
dc.TextOut(pts[4].x,pts[4].y-12,"4",1);
pts[5].x = rc.right - 1;
pts[5].y = rc.top + 2;
dc.TextOut(pts[5].x,pts[5].y,"5",1);
pts[6].x = rc.right -1;
pts[6].y = rc.bottom;
dc.TextOut(pts[6].x-10,pts[6].y,"6",1);
pts[7].x = rc.right -1;
pts[7].y = rc.bottom;
dc.TextOut(pts[7].x,pts[7].y,"7",1);
dc.Polyline(pts,8);
}
}
结果: