绘制曲线并在表单中移动它 [英] Draw a curve and move it in the form

查看:95
本文介绍了绘制曲线并在表单中移动它的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Point p61 = Point(x3,y3);
Point p64 = Point(x4,y4);
Point p65 = Point(x5,y5);

cli::array<point>^ curvePoint6 = { p61,p64,p65 };
g->DrawCurve(blackpen, curvePoint6);



这是曲线绘图的代码

我想要这条曲线向任何方向移动


this is code for curve drawing
and I want this curve to move in any direction

private: System::Void timer1_Tick(System::Object^  sender, System::EventArgs^  e) {
//here i am trying to move it from left to right
x3++;
x4++;
x5++;
Refresh();
//when x4 reach 100 place 

while(x4 = 100 )
{
y3++;
y4++;
y5++;
Refresh();
}
}

我教过这种方法有效,但整条曲线没有移动而是递增而且曲线越来越大

请让我知道如果有任何其他方法可以做

谢谢



我尝试了什么:



i尝试在计时器滴答功能中递增

i taught this method works but the whole curve is not moving instead it increments and the curve is becoming bigger
please let me know if there is any other method to do
thank you

What I have tried:

i tried incrementing in timer tick function

推荐答案

正如jeron所写的那样,while是有缺陷而且不需要。



为什么你不使用方便的功能 Graphics.FillEllipse



如果你想手动绘制一个圆圈,你需要一些关于电子化和一些C ++代码
As jeron has written the while is buggy and not needed.

Why arent you using the handy function Graphics.FillEllipse?

If you want manually draw a circle you need some knowledge about trigonomy and some C++ code.


这篇关于绘制曲线并在表单中移动它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆