Microsoft KB Archive/272939

{|
 * width="100%"|

BUG: AngleArc and ArcTo Don't Sweep Far Enough

 * }

Q272939

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API)

-

SYMPTOMS
Neither the AngleArc nor the ArcTo function sweeps far enough in some situations.

The following code illustrates this problem. If you use this code as the WM_PAINT handler for a test application and then resize the window, you will see that, at some sizes, there will be a small gap between the end of the arc sweep and the beginning of the line segment that denotes where the sweep should have ended.

case WM_PAINT: {   PAINTSTRUCT   ps; HDC hdc = BeginPaint( hWnd, &ps); int iSide; RECT rc; char szBuffer[64];

GetClientRect(hWnd, &rc); iSide = min(rc.right,rc.bottom);

wsprintf(szBuffer, &quot;Side: %lu     &quot;, iSide); TextOut(hdc,0,0,szBuffer, lstrlen(szBuffer)); MoveToEx(hdc, iSide/2, iSide/2, NULL); LineTo(hdc, iSide, iSide/2); AngleArc(hdc, iSide/2,iSide/2, iSide/2, 0.0f, 45.0f); //ArcTo(hdc, 0, 0, iSide, iSide, 1000,iSide/2,iSide,0); LineTo(hdc, iSide/2, iSide/2); EndPaint( hWnd, &ps); } break;

RESOLUTION
The only way to reliably work around this problem is to write your own implementation of these functions. The code described in the following Microsoft Knowledge Base could serve as a starting point:

"Q125693 HOWTO: AngleArc in Windows 3.1, Win32s, and Windows 95"

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

Additional query words:

Keywords : kbAPI kbDSupport

Issue type : kbbug

Technology : kbAudDeveloper kbWin32sSearch kbWin32API