蛋疼的MoveToEx函数有关问题。
蛋疼的MoveToEx函数问题。。。
请问MoveToEx函数设定当前位置后,这个“当前位置会改变”?
我的理解是不会动,所有线段的起点都是(100,100),画出来就像一个鸡爪一样的,
但为什么会是一个矩形吗?
我猜想是起点会不断改变,有谁能详细讲解一下吗?
谢谢了。。。
------解决方案--------------------
Remarks
The coordinates of the line's ending point are specified in logical units.
The line is drawn by using the current pen and, if the pen is a geometric pen, the current brush.
If LineTo succeeds, the current position is set to the specified ending point.
- C/C++ code
POINT apt[5]={100,100,200,100,200,200,100,200,100,100};//五个点的数组,表示一个矩形的轮廓,最后一个顶点的值与第一个点完全相同。 MoveToEx(hdc,apt[0].x,apt[0].y,NULL); //设置当前位置 for (i=1;i<5;i++) { LineTo(hdc,apt[i].x,apt[i].y); }
请问MoveToEx函数设定当前位置后,这个“当前位置会改变”?
我的理解是不会动,所有线段的起点都是(100,100),画出来就像一个鸡爪一样的,
但为什么会是一个矩形吗?
我猜想是起点会不断改变,有谁能详细讲解一下吗?
谢谢了。。。
------解决方案--------------------
Remarks
The coordinates of the line's ending point are specified in logical units.
The line is drawn by using the current pen and, if the pen is a geometric pen, the current brush.
If LineTo succeeds, the current position is set to the specified ending point.