1.windows编程常用

1.画线

1 HDC hdc;
2 hdc = ::GetDC(m_hWnd);
3 ::MoveToEx(hdc, 100, 400, NULL);
4 ::LineTo(hdc, 240, 400);

2.填充矩形

1 HDC hdc;
2 hdc = ::GetDC(m_hWnd);
3 //::Rectangle(hdc, 0, 0, 1000, 1000);
4 CRect rt(0, 0, 1000, 1000);
5 CBrush pNewBrush(RGB(0, 255, 255));
6 FillRect(hdc, rt, pNewBrush);

3.画矩形

1 HDC hdc;
2 hdc = ::GetDC(m_hWnd);
3             
4 Rectangle(hdc, x1, y1,x2, y2);

 

posted @ 2017-12-30 23:12  喵小喵~  阅读(121)  评论(0编辑  收藏  举报