bezier曲线,我的程序是通过前4个点画一条曲线,通过后4个点再画一条曲线,但是不能
保证两条曲线在交点处的斜率相同,有什么办法可以让我可以通过鼠标调整,我还是初学vc,请高手给个思路,有源程序更好,谢谢!
17 个解决方案
#1
高手都来啊
#2
up
#3
bezier曲线---有什么公式??
写出来呀!
写出来呀!
#4
1。根据LBUTTON_DOWN确定点的X,Y,放入数组中
2。根据前四个点,调用贝塞尔曲线函数绘制。
3。根据后四个点,调用贝塞尔曲线函数绘制。
4。如要调整,确定鼠标点击的X,Y是否在数组中,如是则根据鼠标移动动态改变该点的x,y数据。以后再重新执行2,3步骤。
2。根据前四个点,调用贝塞尔曲线函数绘制。
3。根据后四个点,调用贝塞尔曲线函数绘制。
4。如要调整,确定鼠标点击的X,Y是否在数组中,如是则根据鼠标移动动态改变该点的x,y数据。以后再重新执行2,3步骤。
#5
贝页斯曲线,好熟呀,就是忘了什么内容了。哈哈
鼠标调整?也就是拖动端点2不断将端点2与端点1之间的连线重画,重载OnLButtonDown、OnMouseMove这些函数吧。
鼠标调整?也就是拖动端点2不断将端点2与端点1之间的连线重画,重载OnLButtonDown、OnMouseMove这些函数吧。
#6
可以说的详细点吗?谢谢
#7
up
#8
在CDC类中,就有画多个点的贝页斯曲线,自己可以去查查,但点数是有限制的。好像为3n个点。
PolyBezier( const POINT* lpPoints, int nCount );
lpPoints
Points to an array of POINT data structures that contain the endpoints and control points of the spline(s).
nCount
Specifies the number of points in the lpPoints array. This value must be one more than three times the number of splines to be drawn, because each Bézier spline requires two control points and an endpoint, and the initial spline requires an additional starting point.
Remarks
Draws one or more Bézier splines. This function draws cubic Bézier splines by using the endpoints and control points specified by the lpPoints parameter. The first spline is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the end point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third is the end point.
The current position is neither used nor updated by the PolyBezier function. The figure is not filled. This function draws lines by using the current pen.
PolyBezier( const POINT* lpPoints, int nCount );
lpPoints
Points to an array of POINT data structures that contain the endpoints and control points of the spline(s).
nCount
Specifies the number of points in the lpPoints array. This value must be one more than three times the number of splines to be drawn, because each Bézier spline requires two control points and an endpoint, and the initial spline requires an additional starting point.
Remarks
Draws one or more Bézier splines. This function draws cubic Bézier splines by using the endpoints and control points specified by the lpPoints parameter. The first spline is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the end point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third is the end point.
The current position is neither used nor updated by the PolyBezier function. The figure is not filled. This function draws lines by using the current pen.
#9
up
#10
Widnows API中带有bezier曲线的绘制函数,找一下吧。
我记得在经典《Windows程序设计》中就介绍过。
我记得在经典《Windows程序设计》中就介绍过。
#11
up
#12
up
#13
直接调用bezier曲线绘制函数就行
#14
好像是CDC中的成员
#15
up
#16
gz
#17
up
#1
高手都来啊
#2
up
#3
bezier曲线---有什么公式??
写出来呀!
写出来呀!
#4
1。根据LBUTTON_DOWN确定点的X,Y,放入数组中
2。根据前四个点,调用贝塞尔曲线函数绘制。
3。根据后四个点,调用贝塞尔曲线函数绘制。
4。如要调整,确定鼠标点击的X,Y是否在数组中,如是则根据鼠标移动动态改变该点的x,y数据。以后再重新执行2,3步骤。
2。根据前四个点,调用贝塞尔曲线函数绘制。
3。根据后四个点,调用贝塞尔曲线函数绘制。
4。如要调整,确定鼠标点击的X,Y是否在数组中,如是则根据鼠标移动动态改变该点的x,y数据。以后再重新执行2,3步骤。
#5
贝页斯曲线,好熟呀,就是忘了什么内容了。哈哈
鼠标调整?也就是拖动端点2不断将端点2与端点1之间的连线重画,重载OnLButtonDown、OnMouseMove这些函数吧。
鼠标调整?也就是拖动端点2不断将端点2与端点1之间的连线重画,重载OnLButtonDown、OnMouseMove这些函数吧。
#6
可以说的详细点吗?谢谢
#7
up
#8
在CDC类中,就有画多个点的贝页斯曲线,自己可以去查查,但点数是有限制的。好像为3n个点。
PolyBezier( const POINT* lpPoints, int nCount );
lpPoints
Points to an array of POINT data structures that contain the endpoints and control points of the spline(s).
nCount
Specifies the number of points in the lpPoints array. This value must be one more than three times the number of splines to be drawn, because each Bézier spline requires two control points and an endpoint, and the initial spline requires an additional starting point.
Remarks
Draws one or more Bézier splines. This function draws cubic Bézier splines by using the endpoints and control points specified by the lpPoints parameter. The first spline is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the end point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third is the end point.
The current position is neither used nor updated by the PolyBezier function. The figure is not filled. This function draws lines by using the current pen.
PolyBezier( const POINT* lpPoints, int nCount );
lpPoints
Points to an array of POINT data structures that contain the endpoints and control points of the spline(s).
nCount
Specifies the number of points in the lpPoints array. This value must be one more than three times the number of splines to be drawn, because each Bézier spline requires two control points and an endpoint, and the initial spline requires an additional starting point.
Remarks
Draws one or more Bézier splines. This function draws cubic Bézier splines by using the endpoints and control points specified by the lpPoints parameter. The first spline is drawn from the first point to the fourth point by using the second and third points as control points. Each subsequent spline in the sequence needs exactly three more points: the end point of the previous spline is used as the starting point, the next two points in the sequence are control points, and the third is the end point.
The current position is neither used nor updated by the PolyBezier function. The figure is not filled. This function draws lines by using the current pen.
#9
up
#10
Widnows API中带有bezier曲线的绘制函数,找一下吧。
我记得在经典《Windows程序设计》中就介绍过。
我记得在经典《Windows程序设计》中就介绍过。
#11
up
#12
up
#13
直接调用bezier曲线绘制函数就行
#14
好像是CDC中的成员
#15
up
#16
gz
#17
up