随机矩形代码贴出来看看,哆啦A梦那个情况,只要跟着小甲鱼视频做的,都有这个情况出现,解决方法,把画笔改成1,左边只画一条,右边画两条(一条长一条短)。
具体代码实现:把你的如下代码hOldPen = (HPEN)SelectObject(hdc, CreatePen(PS_SOLID, 2, RGB(0, 159, 232)));
MoveToEx(hdc, (cxClient / 2) - 90, (cyClient / 2) + 10, NULL);
LineTo(hdc, (cxClient / 2) - 90, (cyClient / 2) + 50);
MoveToEx(hdc, (cxClient / 2) + 90, (cyClient / 2) + 10, NULL);
LineTo(hdc, (cxClient / 2) + 90, (cyClient / 2) + 50);
替换成hOldPen = (HPEN)SelectObject(hdc, CreatePen(PS_SOLID, 1, RGB(0, 159, 232)));
MoveToEx(hdc, (cxClient / 2) - 90, (cyClient / 2) + 50, NULL);
LineTo(hdc, (cxClient / 2) - 90, (cyClient / 2) + 10);
MoveToEx(hdc, (cxClient / 2) + 90, (cyClient / 2) + 60, NULL);
LineTo(hdc, (cxClient / 2) + 90, (cyClient / 2) + 10);
MoveToEx(hdc, (cxClient / 2) + 89, (cyClient / 2) + 50, NULL);
LineTo(hdc, (cxClient / 2) + 89, (cyClient / 2) + 10);
|