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);