Hello to all you fellow asmerís from around the world. Iím an old DOS asmer from long ago(Iím 50). Gave up programming PCís after Bill Gates sold us Windows. Did a lot of freeware stuff back in the BBS days. Well, thanks to MASM32 Iíve sparked a new interest in PC programming. Hereís my question: Given the starting X and Y, the ending X and Y and the radius of an ARC how in the hell do you approach the use of Windows Arc API. This API needs the upper left this and the lower right that and start and end, doesnít give a damn about the radius. What Iím trying to do is take CNC machine Gcode and give out a visual 2D display of the toolpath. I have no problem with using the Line API or setting up my Window Extents but am totally stumped on how to deal with arcs. Iíve never really had the need to learn much graphics programming until now. Is there an algorithmic way to extrapolate the Arc APIís requirements from Start X,Y - End X,Y and Radius. This old Pennsylvanian needs help!
i think your problem lies in the description of the function (i presume you are using 'Arc') when it says rect, it is a description of a rectangle in which to place the arc. Also with the other four parameters (which i dont know what they mean) it seems to specify some thing else. So really (i think) it does seem indirectly specify the radius. (Microsoft would never think of making anything confusing and 10x more difficult to use than need be would they) but yeah, the easyist way to figure things out is to have a play with the varibles etcs.
The Windows API says: The points (nLeftRect, nTopRect) and (nRightRect, nBottomRect) specify the bounding rectangle. An ellipse formed by the specified bounding rectangle defines the curve of the arc. The arc extends in the current drawing direction from the point where it intersects the radial from the center of the bounding rectangle to the (nXStartArc, nYStartArc) point. The arc ends where it intersects the radial from the center of the bounding rectangle to the (nXEndArc, nYEndArc) point. If the starting point and ending point are the same, a complete ellipse is drawn. Hope that helps. It doesn't hurt to use the Microsoft web site :) http://msdn.microsoft.com/library/psdk/gdi/linecurv_6uoz.htm Take care, bitRAKE