太极 问题 我画了一个 半圆 可是 同白色 画笔覆盖 不了 边
大佬 怎么解决 啊 谢谢了 覆盖 不了 半圆 的边static/image/hrline/line4.png
case WM_PAINT:
hdc = BeginPaint(hwnd, &ps);
GetClientRect(hwnd, &rect);
//判断窗口的高度和宽度的大小
if (rect.bottom < rect.right)
{
//画一个填充为黑色的半圆
SelectObject(hdc,GetStockObject(BLACK_BRUSH));
Pie(hdc, rect.right / 2 - rect.bottom / 2, rect.top, rect.right / 2 + rect.bottom / 2, rect.bottom, rect.right / 2, rect.top, rect.right / 2, rect.bottom);
//画一个填充为白色的半圆
SelectObject(hdc, GetStockObject(WHITE_BRUSH));
Pie(hdc, rect.right / 2 - rect.bottom / 2, rect.top, rect.right / 2 + rect.bottom / 2, rect.bottom, rect.right / 2, rect.bottom, rect.right / 2, rect.top);
//画一个填充为黑色的半圆
SelectObject(hdc, GetStockObject(BLACK_BRUSH));
Pie(hdc, rect.right / 2 - rect.bottom / 4, rect.top, rect.right / 2 + rect.bottom / 4, rect.bottom/2, rect.right / 2, rect.bottom / 2, rect.right / 2, rect.top);
//画一个填充为白色的半圆
SelectObject(hdc, GetStockObject(WHITE_BRUSH));
Pie(hdc, rect.right / 2 - rect.bottom / 4, rect.bottom / 2, rect.right / 2 + rect.bottom / 4, rect.bottom, rect.right / 2, rect.bottom / 2, rect.right / 2, rect.bottom);
//覆盖掉白色半圆的边
SelectObject(hdc, GetStockObject(WHITE_PEN));
MoveToEx(hdc, rect.right / 2, rect.bottom / 2, 0);
LineTo(hdc, rect.right / 2, rect.bottom);
//恢复画笔
SelectObject(hdc,GetStockObject(BLACK_PEN));
//白色园
SelectObject(hdc, GetStockObject(WHITE_BRUSH));
Ellipse(hdc, rect.right / 2 - 20, rect.bottom / 4 - 20, rect.right / 2 + 20, rect.bottom / 4 + 20);
//黑色园
SelectObject(hdc, GetStockObject(BLACK_BRUSH));
Ellipse(hdc, rect.right / 2 - 20, 3*rect.bottom / 4 - 20, rect.right / 2 + 20, 3*rect.bottom / 4 + 20);
//重新设置画刷
SelectObject(hdc, GetStockObject(WHITE_BRUSH));
}
EndPaint(hwnd, &ps);
break; 好了 偏移 一个 像素 就好了
话说 这问题 怎么 解决 参考一下我的画法吧:
http://bbs.fishc.com/thread-92556-1-1.html
页:
[1]