参考:MSDN
Draws an elliptical arc.//画一个椭圆曲线
Specifies the x-coordinate of the upper-left corner of the bounding rectangle (in logical units).//矩形边界的x1
y1Specifies the y-coordinate of the upper-left corner of the bounding rectangle (in logical units).//矩形边界的y1
x2Specifies the x-coordinate of the lower-right corner of the bounding rectangle (in logical units).//矩形边界的x2
y2Specifies the y-coordinate of the lower-right corner of the bounding rectangle (in logical units).//矩形边界的y2
x3Specifies the x-coordinate of the point that defines the arc's starting point (in logical units). This point does not have to lie exactly on the arc.
//曲线的起点x3,不需要这个点在曲线上
y3Specifies the y-coordinate of the point that defines the arc's starting point (in logical units). This point does not have to lie exactly on the arc.
//曲线的起点y3,不需要这个点在曲线上
x4Specifies the x-coordinate of the point that defines the arc's endpoint (in logical units). This point does not have to lie exactly on the arc.
//曲线的终点x4,不需要这个点在曲线上
y4Specifies the y-coordinate of the point that defines the arc's endpoint (in logical units). This point does not have to lie exactly on the arc.
//曲线的终点y4,不需要这个点在曲线上
lpRectSpecifies the bounding rectangle (in logical units). You can pass either an LPRECT or a CRect object for this parameter.
ptStartSpecifies the x- and y-coordinates of the point that defines the arc's starting point (in logical units). This point does not have to lie exactly on the arc. You can pass either a POINT structure or a CPoint object for this parameter.
ptEndSpecifies the x- and y-coordinates of the point that defines the arc's ending point (in logical units). This point does not have to lie exactly on the arc. You can pass either a POINT structure or a CPoint object for this parameter.
Nonzero if the function is successful; otherwise 0.//执行成功返回值非0,否则返回0
The arc drawn by using the function is a segment of the ellipse defined by the specified bounding rectangle.
曲线是被矩形限制的椭圆的一部分。
The actual starting point of the arc is the point at which a ray drawn from the center of the bounding rectangle through the specified starting point intersects the ellipse. The actual ending point of the arc is the point at which a ray drawn from the center of the bounding rectangle through the specified ending point intersects the ellipse. The arc is drawn in a counterclockwise direction. Since an arc is not a closed figure, it is not filled. Both the width and height of the rectangle must be greater than 2 units and less than 32,767 units.
曲线是由如下方式分割的椭圆的一段:由矩形的中心点分别做经过起点、终点的两根射线,将椭圆分为两部分。从起点射线开始,经逆时针旋转到达终点射线的椭圆的一段曲线。
曲线没有填充属性,矩形的宽和高必须在2~32767之间
Header: afxwin.h
CDC 类 层次结构图 CDC::Chord Arc POINT 结构 RECT 结构
//画电抗器代码
void CFunction::DrawVerinductance(CDC *pDC,int i,COLORREF col_pen,CRect rect) { CPen pen(PS_SOLID,i,col_pen),*pOldPen; pOldPen=pDC->SelectObject(&pen); //这里画4个小圆弧 for (int j=0;j<4;j++) { CRect rt; rt.left=rect.left; rt.top=rect.top+j*rect.Height()/4; rt.right=rect.right; rt.bottom=rt.top+rect.Height()/4; pDC->Arc(rt,CPoint(rt.right,rt.bottom),CPoint(rt.left,rt.top)); } DrawLine(pDC,i,col_pen,CPoint(rect.right+2,rect.top),CPoint(rect.right+2,rect.bottom));//圆弧上画一条直线 pDC->SelectObject(pOldPen); pen.DeleteObject(); }
