登录  
 加关注
查看详情
   显示下一条  |  关闭
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!立即重新绑定新浪微博》  |  关闭

面包会有的

... ...

 
 
 

日志

 
 

CDC::Arc  

2008-05-19 09:27:53|  分类: VC++ |  标签: |举报 |字号 订阅

  下载LOFTER 我的照片书  |


CRect object for this parameter.

ptStart

Specifies 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.

ptEnd

Specifies 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.

Remarks

Draws an elliptical arc. 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.

Example

void CCurvesView::OnDraw(CDC* pDC)
{
    // Fill the client area with a thin circle. The circle's
    // interior is not filled. The circle's perimeter is
    // blue from 6 o'clock to 3 o'clock and red from 3
    // o'clock to 6 o'clock.
    // Get the client area.

CRect rectClient;

GetClientRect(rectClient);
    // Make a couple of pens.

CPen penBlue;

CPen penRed;

CPen* pOldPen;

penBlue.CreatePen(PS_SOLID | PS_COSMETIC, 1, RGB(0, 0, 255));

penRed.CreatePen(PS_SOLID | PS_COSMETIC, 1, RGB(255, 0, 0));
    // Draw from 3 o'clock to 6 o'clock, counterclockwise,
    // in a blue pen. pOldPen = pDC->SelectObject(&penBlue);

pDC->Arc(rectClient,

CPoint(rectClient.right, rectClient.CenterPoint().y),

CPoint(rectClient.CenterPoint().x, rectClient.right));


    // Draw from 6 o'clock to 3 o'clock, counterclockwise,
    // in a red pen. pDC->SelectObject(&penRed);
    // Keep the same parameters, but reverse start
    // and end points.

pDC->Arc(rectClient, CPoint(rectClient.CenterPoint().x, rectClient.right), CPoint(rectClient.right, rectClient.CenterPoint().y));
// Restore the previous pen.

pDC->SelectObject(pOldPen);
}

  评论这张
 
阅读(1219)| 评论(0)

历史上的今天

在LOFTER的更多文章

评论

<#--最新日志,群博日志--> <#--推荐日志--> <#--引用记录--> <#--博主推荐--> <#--随机阅读--> <#--首页推荐--> <#--历史上的今天--> <#--被推荐日志--> <#--上一篇,下一篇--> <#-- 热度 --> <#-- 网易新闻广告 --> <#--右边模块结构--> <#--评论模块结构--> <#--引用模块结构--> <#--博主发起的投票-->
 
 
 
 
 
 
 
 
 
 
 
 
 
 

页脚

网易公司版权所有 ©1997-2018