/*-------------------------------------- PROB6.C -- Line-Drawing Problem #6 (c) Charles Petzold, 1994 --------------------------------------*/ #include char szClass [] = "Prob6" ; char szTitle [] = "Prob6: Line-Drawing Problem #6" ; 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) ; BeginPath (hdc) ; MoveToEx (hdc, 100, 100, NULL) ; LineTo (hdc, 300, 100) ; ArcTo (hdc, 300, 400, 600, -200, 300, 100, 600, 100) ; LineTo (hdc, 800, 100) ; SetArcDirection (hdc, AD_COUNTERCLOCKWISE) ; ArcTo (hdc, 100, 600, 800, -400, 800, 100, 100, 100) ; CloseFigure (hdc) ; EndPath (hdc) ; StrokePath (hdc) ; DeleteObject (SelectObject (hdc, GetStockObject (BLACK_PEN))) ; }