/*-------------------------------------- PROB3.C -- Line-Drawing Problem #3 (c) Charles Petzold, 1994 --------------------------------------*/ #include char szClass [] = "Prob3" ; char szTitle [] = "Prob3: Line-Drawing Problem #3" ; void PaintRoutine (HWND hwnd, HDC hdc, int cxArea, int cyArea) { LOGBRUSH lb ; SetMapMode (hdc, MM_LOENGLISH) ; SetViewportOrgEx (hdc, 0, cyArea, NULL) ; lb.lbStyle = BS_SOLID ; lb.lbColor = RGB (0, 0, 0) ; lb.lbHatch = 0 ; SelectObject (hdc, ExtCreatePen (PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_FLAT | PS_JOIN_ROUND, 100, &lb, 0, NULL)) ; SetArcDirection (hdc, AD_CLOCKWISE) ; MoveToEx (hdc, 100, 100, NULL) ; LineTo (hdc, 300, 100) ; Arc (hdc, 300, 400, 600, -200, 300, 100, 600, 100) ; MoveToEx (hdc, 600, 100, NULL) ; LineTo (hdc, 800, 100) ; DeleteObject (SelectObject (hdc, GetStockObject (BLACK_PEN))) ; }