Arc函数使用说明
来源:互联网 发布:小可知乎 编辑:程序博客网 时间:2024/04/28 08:22
BOOL Arc(
HDC hdc, // handle to device context
int nLeftRect, // x-coord of rectangle's upper-left corner
int nTopRect, // y-coord of rectangle's upper-left corner
int nRightRect, // x-coord of rectangle's lower-right corner
int nBottomRect, // y-coord of rectangle's lower-right corner
int nXStartArc, // x-coord of first radial ending point
int nYStartArc, // y-coord of first radial ending point
int nXEndArc, // x-coord of second radial ending point
int nYEndArc // y-coord of second radial ending point
测试结果图
HDC hdc, // handle to device context
int nLeftRect, // x-coord of rectangle's upper-left corner
int nTopRect, // y-coord of rectangle's upper-left corner
int nRightRect, // x-coord of rectangle's lower-right corner
int nBottomRect, // y-coord of rectangle's lower-right corner
int nXStartArc, // x-coord of first radial ending point
int nYStartArc, // y-coord of first radial ending point
int nXEndArc, // x-coord of second radial ending point
int nYEndArc // y-coord of second radial ending point
);
前四个参数表明了 外接矩形
后四个参数表明了弧线的起始位置,
起点是:矩形的中心点(xCenter,yCenter)和点(nXStartArc, nYStartArc) 做一条直线,该直线和椭圆交于一点,该点便是弧线的起点。
终点的计算类似。
弧线的方向默认是逆时针。
部分测试代码
case WM_PAINT:hdc = BeginPaint(hWnd, &ps);// TODO: 在此添加任意绘图代码... Rectangle(hdc,91,291,309,109);TextOut(hdc,200,200,TEXT("(200,200)"),lstrlen(TEXT("(200,200)")));TextOut(hdc,350,50,TEXT("(300,50)"),lstrlen(TEXT("(300,50)")));TextOut(hdc,350,350,TEXT("(350,350)"),lstrlen(TEXT("(350,350)")));SelectObject(hdc,(HPEN)CreatePen(PS_SOLID,1,RGB(255,0,0)));//画弧线的函数Arc(hdc,91,291,309,109,350,50,350,350);SelectObject(hdc,(HPEN)CreatePen(PS_SOLID,1,RGB(0,0,255)));MoveToEx(hdc,200,200,NULL);LineTo(hdc,350,50);MoveToEx(hdc,200,200,NULL);LineTo(hdc,350,350);EndPaint(hWnd, &ps);break;
测试结果图
红色为弧线。
两个蓝色线段作用 : 截取 起点和终点
坐标(300,50)和(350,350)分别标明了弧线的起点和终点。
Arc与ArcTo的区别在于,Arc函数只是绘出给定的弧线,不会对画笔位置产生影响;而ArcTo函数在工作时将会从画笔原来所在点开始绘制一条直线到弧线的开始点,绘画弧线完成后还会将画笔移动到弧线的终点,从而对画笔位置造成影响。
0 0
- Arc函数使用说明
- ARC使用说明
- HTML5 Canvas 2D arc方法使用说明
- canvas 画图----arc函数
- arc(逆欧拉函数)
- 逆欧拉函数[arc]
- header()函数使用说明
- header()函数使用说明
- informix sql函数使用说明
- FirebirdSQL内置函数使用说明
- header()函数使用说明
- Excel函数使用说明
- php header()函数使用说明
- memset()函数使用说明
- API 函数 EnumProcesses 使用说明
- FirebirdSQL内置函数使用说明
- slect函数的使用说明
- 异步socket函数使用说明
- layout没显示layout布局手机
- 提高第12课时,自测
- 死锁和线程之间的通信
- Java虚拟机体系结构 - 访问策略2
- CSU1600:Twenty-four point(DFS)
- Arc函数使用说明
- java远程debug
- my eclipse 的代码提示功能
- UVA - 656 Optimal Programs
- java生成者消费者队列实现(全)
- NSDictionary和NSMutableDictionary
- bzoj 1862/1056 [HAOI2008]排名系统
- 仿手机酷狗-音乐播放页面拖动效果
- CSU1604: SunnyPig(BFS)