MFC画圆弧

L_hsh 2008-11-15 08:24:45
怎样用圆心、半径、起始角度画圆弧。
...全文
1326 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
L_hsh 2008-11-22
  • 打赏
  • 举报
回复
谢谢,我明白了。
Show_Mike 2008-11-16
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 L_hsh 的回复:]
请说的具体点,好吗,如圆心(20,20),半径15,从pi/到pi/2。
[/Quote]


//函数原型
BOOL AngleArc(
HDC hdc, // handle to device context
int X, // x-coordinate of circle's center
int Y, // y-coordinate of circle's center
DWORD dwRadius, // circle's radius
FLOAT eStartAngle, // arc's start angle
FLOAT eSweepAngle // arc's sweep angle
);
//具体使用
AngleArc(hdc,20,20,15,pi,-pi/2);//eSweepAngle是相对起始角度计算的角度值


wywgk 2008-11-16
  • 打赏
  • 举报
回复
CDC::Arc
BOOL Arc( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 );

BOOL Arc( LPCRECT lpRect, POINT ptStart, POINT ptEnd );

你可以看一下MSDN

有区域和两个点就可以画出一段弧.

你的圆心就是区域的中心,你给出的两个点就是圆心和你的弧线的两个端点连接线和X轴\Y轴的交点

把这些代到函数里就行了
L_hsh 2008-11-16
  • 打赏
  • 举报
回复
请说的具体点,好吗,如圆心(20,20),半径15,从pi/到pi/2。
fleer 2008-11-16
  • 打赏
  • 举报
回复
BOOL Arc( int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4 );

BOOL Arc( LPCRECT lpRect, POINT ptStart, POINT ptEnd );

int x1, int y1, int x2, int y2或者LPCRECT lpRect提供的是圆或椭圆所在的四边形,int x3, int y3或POINT ptStart表明的是圆弧的起点,int x4, int y4或POINT ptEnd 是圆弧的终点。圆弧是按照逆时针方向画的
superdiablo 2008-11-15
  • 打赏
  • 举报
回复
Arc
Draws an elliptical arc.
ArcTo
Draws an elliptical arc. This function is similar to Arc, except that the current position is updated.
AngleArc
Draws a line segment and an arc, and moves the current position to the ending point of the arc.
matrixnull 2008-11-15
  • 打赏
  • 举报
回复
CDC::AngleArc

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧